-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[typescript] use the language service for tokenization #11580
Comments
I also think that tokenizers implemented by language servers is an interesting idea that we should evaluate again. |
Agree on this. I think we need to distinguish between syntax classification which happens in the render and semantic classification which happens in the language server. Syntax classification should be simple. |
As the syntax of JS and TS isn't simple, its classification can't be simple. It needs a parser, you can't get by with a bunch of regexps here. E.g. On this screenshot, VS is on the left, VS Code on the right. See how |
I am in favor of adding extension host API where a semantic classifier can complement a "dumb" top-down colorizer. NB even without further API this can be accomplished today through decorations, although I would not recommend it :) |
Was annoyed by TM as well and one of the key reasons for alm. Some docs on how that was done : https://basarat.gitbooks.io/alm/content/contributing/syntax.html 🌹 |
I'm looking to interact with the TS language server in order to deliver decorations for:
Is this blocking something like what I have in mind? Or could someone point me towards resources for interacting with the TS server, such as how it provides inferred type info on hover? |
duplicate of #216 |
There is too many issues with the TM grammar, many of which seem to be impossible to fix.
E.g. in microsoft/TypeScript-TmLanguage#121, we can read this:
Isn't it better to try another approach (the one that Visual Studio uses) instead of trying to fix the unfixable?
The text was updated successfully, but these errors were encountered: