3 ms·
Quick follow up, looked into the LSP spec and it does define "SemanticTokens" since 3.16 https://microsoft.github.io/language-server-protocol/specifications/ls
by Difwif 3y ago
Quick follow up, looked into the LSP spec and it does define "SemanticTokens" since 3.16
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens https://microsoft.github.io/language-server-protocol/specifi...
Obviously it depends on the LSP implementation but it looks expressive enough to replace treesitter?
- mdaniel 3y agoThat was interesting, thanks for pointing it out I was tremendously sad to see that the Typescript Language Server wasn't owned by Microsoft <https://microsoft.github.io/language-server-protocol/implementors/servers/ https://microsoft.github.io/language-server-protocol/impleme...>, since if there was any sanity in the world a spec bump would travel with a reference implementation showing how they envision such a thing being used But, I found that the Typescript Language Server that they did list does indeed have a semantic-tokens module in it, although it's much shorter than I would have expected from reading that section in the spec: https://github.com/typescript-language-server/typescript-language-server/blob/v3.3.2/src/features/semantic-tokens.ts https://github.com/typescript-language-server/typescript-lan...
- tuukkah 3y agoThat code implements a (luckily) simple transformation from Microsoft's tsserver format to Microsoft's LSP format: > Transforms the semantic token spans given by the ts-server into lsp compatible spans