ReSharper-如何在IntelliSense中显示自定义代码段 [英] ReSharper - How to show custom snippet in IntelliSense
问题描述
我创建了一个包含快捷方式proplto
的自定义代码段.如果我按Ctrl-K,Ctrl-X并打开我的代码段",则可以选择我的代码段.我也可以在代码中键入proplto
,点击TAB,然后插入代码段.但是,我找不到在IntelliSense中显示我的代码段的方法.它显示prop
和propg
,但不显示我的proplto
.我尝试通过转到 Resharper>模板资源管理器,选择 C#并导入我的代码段来添加代码段.它说:在文件中找不到'Live Templates'类型的模板.
I've created a custom snippet that contains a shortcut proplto
. If I hit Ctrl-K, Ctrl-X and open My Code Snippets I can select my snippet. I can also type proplto
in code, hit TAB and the snippet is inserted. However, I can't find a way to display my snippet in IntelliSense. It shows prop
and propg
but not my proplto
. I tried adding my snippet by going to Resharper > Templates Explorer, selecting C# and importing my snippet file. It says "No templates of type 'Live Templates' found in the file.'
VS2013 Ultimate ReSharper 8.2
VS2013 Ultimate ReSharper 8.2
推荐答案
ReSharper Live Templates功能不支持Microsoft代码段.因此,您需要在ReSharper | Template Explorer | C# | New
中手动创建一个新的实时模板,然后在其中键入所需的代码.有关如何创建实时模板的更多信息,您可以在此处
ReSharper Live Templates feature does not support Microsoft Code Snippets. So, you need to create a new live template manually in ReSharper | Template Explorer | C# | New
and type needed code there. More info how to create Live Templates you may find here
将proplto
动态模板添加到模板管理器后,它将在IntelliSense中可用.
After you adding proplto
Live Template to Templates Manager, it will be available in IntelliSense.
ReSharper 9.0:
ReSharper>工具>模板资源管理器
ReSharper 9.0:
ReSharper>Tools>Templates Explorer
这篇关于ReSharper-如何在IntelliSense中显示自定义代码段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!