I want to write a new templating language, and I want Visual Studio to "support" it. What I need to know is:
I'd prefer to write my parser in C#.
Modify language packs To do so: Choose the Language packs tab in the Visual Studio Installer. Select the language you prefer. Follow the prompts.
1) You cannot have a Visual Studio project that uses multiple languages (unless you count ASM in C/C++). However, a single Visual Studio solution can have multiple projects where each project uses a different language.
Once the installer is launched, click on Modify to modify the current installation of Visual Studio. 3. Then, you'll want to click on the Language Packs tab and select the language pack that you wish to install.
The standard way On the tab Installed, click button Modify next to the version of Visual Studio you need the English language pack for: In the next window, select Language packs tab, tick the English language and then accept changes by clicking Modify button (right bottom corner).
I would take a look at another language that has already done the legwork of integrating with Visual Studio. A great example is Boo. The language and Visual Studio integration are open source. So you can take a look at exactly what they had to do.
The Boo Syntax Highlighting for VS2010 includes some recommended links on its homepage, which I'll copy for easy reference:
Regarding the Visual Studio aspects, what you need is a "language service", which is the entity that handles colorizing, intellisense, etc. for a given file extension/type.
For an intro, see this article
And for a code sample see here
Regarding parsing, there are lots of technologies, and I won't offer an opinion/advice.
Beware, there is a fair amount of work involved, although in my opinion it is much more straightforward in VS2010 than in previous versions of Visual Studio to provide this kind of extension.
See also
Visual Studio 2010 Extensibility, MPF and language services
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With