Can I add links in comments to a code block in Visual studio ?
For example:
// block 1
class class1
{
}
// block 2
class class2
{
// review [___class1]
}
[___class1] is a link for class1
Thanks in advance.
Comment Code Block Ctrl+K+C/Ctrl+K+U If you select a block of code and use the key sequence Ctrl+K+C, you'll comment out the section of code. Ctrl+K+U will uncomment the code.
Select an existing control or drag and drop a control from the Visual Studio toolbox onto the design surface. Right-click the control to open the Properties Window. In the Properties Window, set the HyperLink property to mailto: any valid e-mail address.
You can bookmark your code in Visual Studio, but that's stored in your user options file and isn't normally checked into source control. I don't know of a way to link to portions of code from other portions of code.
Your best bet might be to use document comments and a <see>
tag:
/// <see cref="Fully.Qualified.Type.Name"/>
But that's going to be limited to fully qualified locations, i.e. types, methods, fields, and properties. A particular block (say, an if
statement within a method) is right out, and it'll only link the documentation for that method/whatever to another documentation section, and then only if you generate the documentation using a tool like Sandcastle.
One other thing you might consider, and this is a very bad hack, is to use file hyperlinks, like so:
// file://c:/code/file.cs
There are caveats:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With