Visual Studio 2010 URL Hyperlink color - is it possible to not use this?

梦想与她 提交于 2020-01-11 19:57:04

问题


Visual Studio 2010 "helpfully" detects URLs and colors them blue (by default). It will do this regardless of context - whether the URL is in the midst of XML, or it's in a comment, or it's a string in code, etc. I find this distracting. The URLs are part of their context. I'm not coding in Visual Studio in order to click on hyperlinks.

Is there any way to have Visual Studio treat URL hyperlinks the same as surrounding text? I know you can change the color from blue to something else (Tools-Options-Fonts and Colors-Display Items-URL Hyperlink). I don't want the URLs to display any specific color, but instead use the surrounding context color.


回答1:


Yes: disable

Tools\Options\Text Editor\your language here\Enable single click URL navigation

to turn off the 'helpful' feature.




回答2:


For those of you that googled into here trying to disable this on the express version of VS2010:

You won't find the option to remove this 'feature' under tools, and unfortunately you cannot install that VSIX from Noah Richards.

What you can do, though, is change the option directly in the registry:

HKEY_CURRENT_USER\Software\Microsoft\VCSExpress\10.0\Text Editor\CSharp

there, change the value of "Make URLs Hot" to "0" and you're done.

(This is for c#. For c++ or others, I guess the path would be a bit different, but along the same lines).




回答3:


You can't do it from a setting in the product, but I just wrote an extension that does it for you (called "ClearHyperlinkForeground"). You can download the VSIX here. You can also view the source on github, if you are curious how it works or want to build it for yourself. It's essentially a copy of my ItalicComments extension, just modified to clear the foreground brush of the URL formatting instead of italicizing comments.



来源:https://stackoverflow.com/questions/3153409/visual-studio-2010-url-hyperlink-color-is-it-possible-to-not-use-this

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!