Hi,
I use GVim and Visual Studio for coding. One of the most missing features in VS compared to GVim is the possibility to highlight several words in different colors simultaneously. See this screenshot of a GVim session for an example (wResult and fBufferLocked are marked)
In GVim I use this feature very often to get a quick overview where which variable is used.
I haven't found a plug-in which provides this feature for VS. I know solutions which can highlight one(!) keyword, but not several and in different colors. So I plan to write a plug-in for VS 2008 which implements this feature (unless someone now gives a link to an off-the-shelf plug-in which does what I'm missing so much ;-))
Well, the problem is that I'm not experienced in writing plug-ins for VS 2008 (or any other VS). And before starting to learn what the plug-in architecture of VS is I would like to get some feedback from you whether such a plug-in is possible at all and what effort it is to implement it.
The idea is the following:
If the user presses a specific shortcut key in VS's code editor the word under the cursor is added to VS's syntax highlighting. Say this is word 1 with background color 1. All keywords "word 1" are highlighted now.
If the user moves the cursor over another word and presses the shortcut key this word will also be added to the syntax highlighting, but with a different background color. Say this is word 2 with background color 2.
If the cursor is over an already highlighted word and the user presses the shortcut key then the word is removed from the syntax highlighting.
So basically the plug-in should add keywords to the current syntax highlighting and remove them on demand.
My questions:
Is the approach to do this via syntax highlighting and plug-in a correct one or are there (better, simpler) alternatives?
Does this approach work at all? Or, to put it differently:
2.1. Can an existing syntax highlighting (e.g. C++) be expanded while VS is running?
2.2. If a keyword is added/removed to/from the syntax highlighting on runtime, when does VS update the editor's view? Automatically when changing the highlighting, must and can a plug-in trigger an update of the editor's view or must VS be restarted (the last one would be the knock out for this idea)?
Is there an open-source VS 2008 plug-in which does something with syntax highlighting, marking code or anything similar which I could use as a starting point to learn? A good starting point in MSDN seems to be this and rightnow while typing this I have found a plug-in which at least deals with syntax highlighting.
Thank you in advance for your comments...
Greetings
Habi