by simplotek · 4y ago · 0 comments
Vs code supports language server protocol [1] and also includes support for syntax highlighting [2]
If I recall correctly, vim supports syntax highlighting through less-than-elegant regex searches.
[1] https://code.visualstudio.com/api/language-extensions/langua...
[2] https://code.visualstudio.com/api/language-extensions/syntax...
Treesitter, also built-in to Neovim, provides semantic syntax highlighting, just like an IDE.
And Vim can use LSP using a plug-in like Coc.
What %ge of languages supported by vim are actually supported by microsoft - or "the microsoft community?"
Today VS Code also allows for Language Server processes to entirely delegate syntax highlighting as well, if you do need a very custom turing-complete tokenizer. (More accurately, it is included so that Language Servers can share the tokenizer work they are already doing as part of their parsing and processing efforts rather than duplicate that effort in a TextMate Grammar.)
Wrapping a TextMate Grammar in a VS Code extension is one of the easiest types of extension to build for VS Code, it's just the grammar JSON file and a couple lines added to an appropriate package.json file added to a ZIP file that then ostensibly resembles an npm package.
Deeper projects such as Language Servers start to get complicated quickly, but also are where a lot of power that VS Code has that vim is starting to import the other direction: many neovim users rely on Language Servers ostensibly built for VS Code first for an increasing number of language features.
[1] https://code.visualstudio.com/api/language-extensions/syntax...