-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Support sending some commands to syntax TS Server while a project is loading #99643
Comments
For #99643 Add a new server option for TypeScript that routes request based on if a project is loading or not The is enabled by the undocumented `"typescript.tsserver.useSeparateSyntaxServer": "dynamic"` setting
See microsoft/TypeScript#38564 for the TS work on this 480c98f should enabled this in VS Code (you'll need to wait for the first VS Code 1.47 insiders build). To enable this, just set |
Nice! (@amcasey) Just to be clear, it looks like it's not just intellisense/completions, right? It looks like the syntax server will basically handle every operation except for diagnostics: |
Yes, during project load syntax server should now get every command except the diagnostic ones and |
We probably don't want any of the compile-on-save commands to go to the syntax server. |
Organize imports can only mangle things. Personally, I'd also drop semantic classification (e.g. class vs interface) since I don't think a guess is better than nothing (e.g. just knowing its a type). |
I'm not able to see things working better. I've
|
@DanielRosenwasser You need to be on the VS code 1.47 insiders builds which have not been released yet. They should come out once we ship the stable version of VS Code 1.46 |
D'oh - thanks! By the way, I (like @amcasey) tried out the syntax-only server and the results are pretty great already. Very excited to see how this works out. |
To verify this:
Keep in mind that these operations only look at the current file while the project is loading. Confirm that once the project loads, you start getting full results |
Problem
VS Code runs two TS servers for our JavaScript and TypeScript support:
Syntax Server. Use for basic syntax related operations, such as outline, auto closing tags, etc. Only loads the current file
Semantic server. Used for more advanced operations such as errors and intellisense. Requires loading the entire project
For larger projects, the semantic server can take time to load the entire project and start providing responses. While the project is loading, the user does not get any IntelliSense.
Here's the state of things today:
Proposal
We'd like to explore improving the UX while a project is loading by letting the syntax server handle basic semantic operations until the project has been fully loaded:
While loading is happening, we plan to use the syntax server to implement semantic operations such as hover and IntelliSense.
The key limitation of this approach is that the syntax server only knows about the current file, so it will not be able to provide complete results. For example, IntelliSense would only include suggestions from the current file and would not be able to support auto imports
The text was updated successfully, but these errors were encountered: