是否可以在 Visual Studio 2010 中的简单注释中创建类似于智能感知的类/类属性/类方法的链接(正在执行 ASP.NET MVC 3 项目,但我想这并不重要)?有没有免费的插件可以实现这个功能?
假设我有这样的代码:
//Blahblahblah
//As you can see on its definition - [SomeClass.SomeProperty] - blahblahblah
//blahblahblah
SomeInstanceOfSomeClass.CallingSomethingUsingSomeProperty(42);
我想单击 [TableModelClass],它将打开新选项卡或切换到已打开的选项卡并自动滚动到类/方法/等的定义,就像您在其他任何地方键入 F12 一样外界评论。
我怀疑互联网上一定有一些 VS 插件...已经谷歌搜索了一段时间...
Is it possible to create an intellisense-like link to a class / class property / class method in a simple comment in Visual Studio 2010 (doing ASP.NET MVC 3 project but i guess that doesn't really matter)? Are there any free plugins for this functionality?
Let's say I have this code:
//Blahblahblah
//As you can see on its definition - [SomeClass.SomeProperty] - blahblahblah
//blahblahblah
SomeInstanceOfSomeClass.CallingSomethingUsingSomeProperty(42);
I want to click on [TableModelClass] which will either open new tab or switch to already opened one and scroll automatically to the definition of class/method/etc., as if you typed F12 on it anywhere else outside comments.
I suspect there must be some VS plugins out there in the Internet...been googling for a while...
发布评论
评论(2)
您无法添加指向其他 type.method 的链接,该链接实际上会在代码中显示为可点击的链接。
但是,您可以使用 XML 文档注释 添加指向其他类型的链接/method 将在对象浏览器、生成的 XML 文档文件或您可能使用 沙堡。
语法是使用
< /a> 或
标记,并将要链接到的类型/方法指定为cref
属性。例如:
You can't add a link to another type.method that will actually appear as a clickable link in your code.
However, you can use XML documentation comments to add a link to another type/method that will appear as a clickable link in the Object Browser, in the generated XML documentation file, or in any other documentation that you might generate from these comments using tools like Sandcastle.
The syntax is to use either the
<see>
or<seealso>
tag, and specify the type/method you want to link to as thecref
attribute.For example:
不确定我的理解是否正确,但在 Visual Studio 2008/2010 中,您只需使用三斜杠
///
即可使用内置智能感知。即:这是您要找的吗?
Not sure if I understand you correctly, but in Visual Studio 2008/2010 you can use the built-in intellisense by simply using triple slashes
///
. Ie:Is this what you are looking for?