开发者

Better C# Syntax Coloring for Visual Studio 2010? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_运维问答

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 9 years ago.

Improve this question

Coming from Eclipse, I'm disappointed with the very limited syntax coloring capabilities offered for C# by Visual Studio (all versions, up to 2010).

In particular, I'm interesting in distinct coloring for methods / fields / locals / static stuff.

I'm aware Visual Assist can enhance the coloring, but I've failed to find any free alternative capable of doing that, so I'm turning to SO (I hope it's programming-related enough). Is there any free (or at least cheaper than Visual Assist) solution capable of enhancing the syntax coloring for C#?


Well, I could understand from the rest of the responses that the answer is a resounding "no, there is no such extension available for free", so I ended up writing one on my own:

Better C# Syntax Coloring for Visual Studio 2010? [closed]

(light brown for methods, magenta for variables, otherwise their color would have been black)

It's a bit crude, but it works for me - and it was free :)

EDIT: Anyone interested in doing the same - using the "Editor Classification" template, bundled with the Visual Studio SDK, is a great starting point.


It's not free, but ReSharper does this (and quite a lot more besides):

http://www.jetbrains.com/resharper/features/coding_assistance.html#Syntax_Highlighting


Hmya, watch out: one IDE's flaw is another IDE's feature. Visual Studio's syntax coloring is purely based on lexical analysis. Fast, simple and always accurate, no matter how completely borked the code is while you are editing it. To get the Eclipse-like coloring, the editor needs to be able to parse the code so it can classify identifiers. That's a much harder problem.

More to the point, there are changes in VS2010 that emphasize doing things exactly the opposite way. To get accurate syntax coloring your preferred way, you'd be likely to focus on getting the class "super-structure" done first. Exactly the opposite of what VS2010 is doing. It lets you skip the boring details and type code. And offers refactorings that lets you automatically create the field/property/method declarations from that code.

Microsoft spends a lot of money researching the most effective use of their software. You're liable to cut yourself off from the innovations they came up with if you try too hard getting things back the way you always did it before.


This is a great free option, http://studiostyl.es/

Import the settings via Tools->Import/Export Settings


JetBrains ReSharper includes enhanced syntax highlighting but costs a bit more than Visual Assist. It is absolutely worth its price but not only for syntax highlighting.

DevExpress offers CodeRush and RefactorPro probably including enhanced syntax highlighting, too, but I am not sure because I just tested it some time ago (at least it has a very colorful overlay when it comes to refactoring). There is a free edition - CodeRush Xpress - available.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜