Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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#?

like image 845
Oak Avatar asked May 30 '10 21:05

Oak


4 Answers

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

like image 27
Warren Rumak Avatar answered Nov 16 '22 05:11

Warren Rumak


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 syntax coloring

(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.

like image 139
Oak Avatar answered Nov 16 '22 07:11

Oak


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.

like image 8
Hans Passant Avatar answered Nov 16 '22 07:11

Hans Passant


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

Import the settings via Tools->Import/Export Settings

like image 1
JaredBroad Avatar answered Nov 16 '22 07:11

JaredBroad