Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically enforce capitalization in Visual Studio 2008?

What is the easiest way to programmatically force capitalization of keywords in Visual Studio 2008?

We work with a proprietary command delimited language (like HTML). We are attempting to migrate from an older editor to Visual Studio 2008. Our coding standards are to capitalize the commands. The old editor is customized to recognize the command begin delimiter and to force capitalization until the end delimiter is typed or the escape key is pressed.

What's the best way to do that in Visual Studio 2008? Can it be done with a macro or an add-in?

(Edited 1-12-2009)

Thank you for the suggestions so far. I don't think they answer my question.

Clarifications:

  • The previous editor was CodeWright so the customizations there are not portable to visual studio.
  • The source code is not C#. StyleCop seems to be specifically for C#. Our language is similar to markup languages like HTML but with different delimiter characters and commands.
  • I am trying to actually capitalize as the developer types, not remind them about proper capitalization. Since the commands are all delimited our current editor actually turns the Caps Lock on when the beginning delimiter is typed. When the end delimiter or the escape key is pressed the caps lock is turned back off. This is independent of the state of the Caps Lock on the keyboard.
like image 792
BubbleSort Avatar asked Sep 12 '26 10:09

BubbleSort


1 Answers

Try out StyleCop, available from Microsoft's web site. You might have to adjust the rule-set for your specific coding standards. For the coding standards we use, it was almost perfect out of the box.

like image 65
DavGarcia Avatar answered Sep 16 '26 08:09

DavGarcia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!