代码段快捷方式无法以美元符号($)启动? [英] code snippet shortcuts cannot be started with a dollar sign ($) ?

查看:90
本文介绍了代码段快捷方式无法以美元符号($)启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从VSCode跳回到VS2017,当我将片段从vscode传输到vs2017时,发现了一些关于快捷方式的奇怪内容。


在VScode中,它是好吧在代码段快捷方式中使用$。然而,似乎在vs2015 / vs2017中,我们不能在快捷方式中使用美元符号。


我只是想知道这是否是设计的,如果是的话,是否有关于什么可以/不可以的ref页用作快捷方式?


下面是我正在使用的示例代码段。

<?xml版本= QUOT; 1.0"编码= QUOT; UTF-8英寸;?> 
< CodeSnippets xmlns =" http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
< CodeSnippet Format =" 1.0.0">
< Header>
< SnippetTypes>
< SnippetType> Expansion< / SnippetType>
< / SnippetTypes>
< Title> conf var< / Title>
< Author> blackbread< / Author>
< Description>
< / Description>
< HelpUrl>
< / HelpUrl>
< Shortcut> $ v < / Shortcut>
< / Header>
< Snippet>
<声明>
< Literal Editable =" true">
< ID>提示< / ID>
< ToolTip>提示< / ToolTip>
<默认>提示< /默认>
<功能>
< /功能>
< / Literal>
< Literal Editable =" true">
< ID>类型< / ID>
< ToolTip>类型< / ToolTip>
<默认>类型< /默认>
<功能>
< /功能>
< / Literal>
< Literal Editable =" true">
< ID>名称< / ID>
< ToolTip>名称< / ToolTip>
<默认>名称< /默认>
<功能>
< /功能>
< / Literal>
< /声明>
< Code Language =" csharp" Delimiter =" $"><![CDATA [[SerializeField] [Tooltip(" $ tips $")]
private $ Type $ _ $ Name $;
public $ Type $ $ Name $ {get {return _ $ Name $; } set {_ $ Name $ = value; }>>< / Code>
< / Snippet>
< / CodeSnippet>
< / CodeSnippets>

解决方案

Hi BlackBread,


欢迎来到MSDN论坛。


我试图遵循这个文档:

演练:创建一个代码段
并使用


作为快捷方式,结果与您的一样,似乎不支持,请尝试使用其他内容作为快捷方式。


要查看代码段快捷方式,请转到工具 - Code Snippets Manager 扫描
每种语言的代码片段,感谢您的理解。




最好的问候,


萨拉


I'm just jumping back from VSCode to VS2017, and find something weird about the shortcuts when I was transferring the snippets from vscode to vs2017.

In VScode, it's okay to use $ in a snippet shortcut. However it seems in vs2015/vs2017 we cannot use the dollar sign in shortcuts though.

I just wonder if this is by design, if so, is there a ref page about what can/cannot be used as shortcuts?

Below is an example snippet I'm using.

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>conf var</Title>
      <Author>blackbread</Author>
      <Description>
      </Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>$v</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <ID>tips</ID>
          <ToolTip>tips</ToolTip>
          <Default>tips</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>Type</ID>
          <ToolTip>Type</ToolTip>
          <Default>Type</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>Name</ID>
          <ToolTip>Name</ToolTip>
          <Default>Name</Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      <Code Language="csharp" Delimiter="$"><![CDATA[[SerializeField][Tooltip("$tips$")]
private $Type$ _$Name$;
public $Type$ $Name$ { get { return _$Name$; } set { _$Name$ = value; } }]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>

解决方案

Hi BlackBread,

Welcome to the MSDN forum.

I tried to follow this doc: Walkthrough: Create a code snippet to and use


as the shortcut, the result like yours, it seems not supported, please try to use other contents as the shortcut.

To view the code snippet shortcut, please go to Tools-Code Snippets Manager to scan the code snippet for each language, thank you for your understanding.

Best regards,

Sara


这篇关于代码段快捷方式无法以美元符号($)启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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