Add a new language to Visual Studio 2010 with synt

2019-03-16 19:35发布

问题:

I am trying to add support for a different language in Visual Studio 2010. I was hoping to add custom syntax highlighting, and have some sort of basic intellisense work with it. The language I am trying to add is 4Js Genero (a newer version of Informix-4GL). I basically just need support for the .4gl and .per file extensions that are used in Genero/4GL. Does anyone know how to do this, or can point me in the right direction?

回答1:

It's not really for the faint of heart. Don't underestimate how much work you'll have to put in.

You'll need the Visual Studio 2010 SDK, and then to read (and re-read, and re-read(*)) all about Language Services

The purpose of a language service in Visual Studio is to provide language-specific support for editing source code in the integrated development environment (IDE). You implement a language service as part of a VSPackage.

(*) - unless it all immediately makes sense to you.



回答2:

This isn't an answer on how to create custom syntax highlighting.

There is an open-source extension for visual studio 2010+ for Genero 4gl language support out of github:

https://github.com/gregfullman/VSGenero/wiki

It should do most of what you're looking for already, and it would certainly make a great starting point for you if you want to do more.