C ++片段支持在视觉工作室? [英] C++ snippet support in visual studio?

查看:134
本文介绍了C ++片段支持在视觉工作室?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本机C ++(不是C ++ / CLR)编写代码。我知道没有内置的支持C + +关于snippet管理器和snipper选择器接口,但是我发现了一个名为snippy的实用工具,据称可以生成C ++片段。这里是程序生成的c ++片段:

I'm writing code in native C++ (not C++/CLR). I know that there is no built-in support for C++ with regards to the snippet manager and snipper picker interfaces, however I found a utility called "snippy" which supposedly can generate C++ snippets. Here is a c++ snippet that the program generated:

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>MySnippet</Title>
      <Shortcut>MySnippet</Shortcut>
      <Description>Just a test snippet</Description>
      <Author>Me</Author>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <ID>literal1</ID>
          <ToolTip>just a placeholder</ToolTip>
          <Default>
          </Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      <Code Language="cpp"><![CDATA[cout << "$literal1$" << std::endl;]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>

如果在Visual C ++中有支持,即使是有限的容量,对于C ++片段,将它们添加到我的环境中,有什么限制?所有我需要的是支持基本的扩展片段,我可以通过键入快捷方式和打击选项卡,并支持基本文字,我可以通过调用(基本上,如果它支持上述代码段,我很好)。如果这不能做,是否有任何免费的附加组件或扩展的visual studio支持C ++的代码片段?我现在使用visual studio 2010和2008,但我现在大多是在2010年写代码。

If there is support in visual C++, even in a limited capacity, for C++ snippets, how do I add them to my environment, and what are the limitations? All I need is support for basic expansion snippets that I can invoke by typing a shortcut and hitting tab, and which supports basic literals that I can tab through (basically, if it supports the above snippet, I'm good). If this can't be done, are there any free add-ons or extensions to visual studio that support snippets for C++? I'm using both visual studio 2010 and 2008, but I mostly write code in 2010 right now.

推荐答案

视觉辅助拥有片段功能与IDE代码段功能不完全相同。它有它的优点和缺点,但在C ++中工作。

Visual Assist has a snippets feature that is not quite the same as the IDE Snippets feature. It has its pros and cons, but does work in C++.

这篇关于C ++片段支持在视觉工作室?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆