-
Notifications
You must be signed in to change notification settings - Fork 12.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
TSServer Reference requests taking a long time #17385
Comments
Nothing stood out in the logs besides the long |
Looking at the logs, it doesn't look like this has to do-with find-all-references. I see I can reproduce this by:
So it looks like it is because we unload the project when the file closes. |
@andy-ms this would be comparable to what we do in VS Code when the last TS file closes. We keep the TS language server around for while to make sure that when a TS file is open briefly afterwards we don't have to pay the startup costs again. |
@andy-ms Just to clarify how this affects the users of VS Code: When you don't use tabs and navigate around we dispose/close documents more aggressive and you are very likely to run into this on every editor input change. So, the suggestion from @kieferrm to wait a little before throwing everything away would make a lot of sense. |
@sheetalkamat was looking at something similar last week. one option is to keep the project information in memory after the file is closed, and then destroy it on the next file open request. this allows us to reuse it if a file from the same project was opened. |
#17269 takes care of this by keeping the configured project alive till after next file open request and I am able to navigate/get completions correctly with the changes from that PR |
Thank you for taking a look @sheetalkamat! Is there a targeted fix that could be backported from that PR to TS 2.5.3? |
the change is rather big, and complicated. we will not be able to port it to 2.5 at the time being. |
@sheetalkamat Do you expect the fix for this to be in by the first 2.6 insiders? Please let us know as soon you there is a build or branch that we can help test |
it should be in |
It will be helpful if you can give |
@mhegazy Yes this seems fixed to me when using typescript@next. Will get some other vscode team members to test this to confirm |
From microsoft/vscode#31344
TypeScript Version: 2.4.2
While working in the VSCode codebase, @kieferrm noticed some major slow downs while working in a TS file. It seem the
references
requests against TSServer are taking up to a second.Here are his repo steps:
master
, no open editorsfrom 'electron'
in all*.ts
filesipcMain
in the editor-> caret stops blinking, it takes several seconds until the underlying word is highlighted and occurrences are shown in the scrollbar (only happens after the reference code lenses are shown)
And the TSServer log:
https://github.com/Microsoft/vscode/files/1171339/tsserver-log.txt
The text was updated successfully, but these errors were encountered: