languageservice

Supporting user-specified file extensions in custom Visual Studio language service

≯℡__Kan透↙ 提交于 2019-11-28 21:53:14
I'm working on a custom Visual Studio language service, and have several questions regarding the way file extensions are bound to a particular language service. Source files for the language "Example Language" has two primary file extensions: .e1 and .e2 . My extension has a class ExampleLanguagePackage which extends Package . When you use the File → Open command and select a C# file (for example), the "Open" button has a dropdown arrow which allows you to select "Open With...". When you click that button, you are presented with options to open the file in the "CSharp Editor (Default)",

How to create a new language for use in Visual Studio

こ雲淡風輕ζ 提交于 2019-11-26 23:30:30
I want to write a new templating language, and I want Visual Studio to "support" it. What I need to know is: How do I parse my new language? Given some code in my new template language, how do I translate it into HTML? Right now I'm using regular expressions to parse it token by token, but I don't think this is going to scale very well as the language gets more complicated, and there's no error checking. I've heard of ANTLR but never used it. Would that be the right tool for this job, or is there perhaps something simpler? Ideally I'd like to send any syntax errors to the error window with as