How to create a new language for use in Visual Studio

前端 未结 7 1855
礼貌的吻别
礼貌的吻别 2020-11-28 17:42

I want to write a new templating language, and I want Visual Studio to \"support\" it. What I need to know is:

  1. How do I parse my new language?
7条回答
  •  醉梦人生
    2020-11-28 18:30

    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

提交回复
热议问题