How do i implement intellisense for my language in

2019-01-21 21:22发布

问题:

I mention that i am designing a language. The plan was always to not implement it but to design it but i am considering implementing it if i think i could do it in a reasonable amount of time.

How would i have my language use intellisense in visual studios? BooLangStudio has it http://www.codinginstinct.com/2008/05/boo-in-visual-studio.html, http://www.codeplex.com/BooLangStudio

回答1:

This is a good place to look for Visual Studio Extensibility.

Also, here. But, the first link has a video specific to adding Intellisense to your language service.



回答2:

It all depends on how much time you want to spend on it. I have about 2,000 hours of work in my Visual Studio IntelliSense projects resulting in exactly one mostly-complete language service. That said, it's not your "average" IntelliSense extension to Visual Studio - see the feature set for more info.

Here are some good resources to look at. I have a tendency to write with an assumption that users are already familiar with both the Visual Studio Extensibility basics and parsing with ANTLR. If you aren't, you should probably start at www.antlr.org and with my "ANTLR port" of one of the simple Visual Studio language service tutorials.

Here are some posts showing how serious I am about the subject. :D

  • How does code completion work?
  • Smart code-completion original and revisited. Clearly I take the latter more seriously than other people (voted down and voted to close?!), but I believe doing so just gives my users a better product. :)
  • High-speed incremental lexing for syntax highlighting original (under IScanner-friendly lexers), cleaned up (significantly - vastly preferable to the original), and made yet again 6x faster in 1/4 the memory.
  • Little things like sane commenting/uncommenting and brace matching do make a difference. On a side note, once you use one that's well-behaved, the others (including the ones for some Microsoft languages in Visual Studio) are rather annoying.
  • If you can, read all the IntelliSense-related posts on my blog.
  • Smart indent is a PITA (I mean really smart, e.g. the C# language service in VS2008). I have a love/hate relationship with it. I'm annoyed now because writing this bullet made me think about it. Argh. My insight here makes me a bit forgiving of them breaking it for VS2010 Beta 1, but it doesn't keep me from missing its awesomeness.

PS: I can now build a syntax highlighter for a new language commenting/uncommenting in 1 day. In the same day I'm ofter able to get the type & member bars in as well.



回答3:

As of 4-4-2017: This article seems to give all of the basics for creating a language extension, which includes highlighting words and providing intellisense (code completion).

https://code.visualstudio.com/docs/extensions/example-language-server