Resharper的IntelliSense仅显示其自己的实时模板,而不显示Visual Studio的代码段。
有没有一种方法可以使Resharper IntelliSense显示所有VS代码片段?
在Resharper的模板资源管理器中,我发现它具有许多标记为的实时摘录 Imported Visual C# Snippets
但是它并没有全部导入,只有一部分导入。例如,Resharper并未propfull
从Visual Studio导入代码段(如propfull
清单1所示,您没有看到):
I can't find a feature in Resharper to import VS code snippets manually, one by one, or all of them together. I tried Import...
button in Live Templates Manager in Resharper but apparently it only allows to import Live Templates(.DotSettings and .XML files, not .snippets files), but not Code Snippets files. Is it possible to import VS code snippets somehow?
All I want is to somehow make all VS code snippets work in Resharper IntelliSense. Maybe there's some third party tool that allows to convert snippets into Live Templates or something? Thanks.
ReSharper在安装或首次启动时不会导入任何VS模板。您在模板资源管理器中看到的所有模板均已手动添加到ReSharper的默认设置-没有“将代码片段转换为实时模板”转换器https://youtrack.jetbrains.com/issue/RSRP-273779。
因此,如果您想propfull
在实时模板中获取模板,则必须手动创建它-打开ReSharper | Tools | Templates Explorer | Live Templates | C# | New Template
并在其中放置以下代码:
private $TYPE$ _$Var$;
public $TYPE$ $Property$
{
get { return _$Var$; }
set { _$Var$ = value; }
}
并调整Var
占位符:Value -> Choose Macro -> "Value of another variable with the first characters in lower case" -> OK -> "another variable" -> Choose "Property"
。也Editable Occurrence -> Not editable
。然后改变占位符的顺序对新增加的模板是如下: - Type
- Property
-Var
在这种情况下,Var
将从Property继承正确的名称。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句