-
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
getEditsForFileRename can take a long time on large project #29031
Comments
Quick API usage question: do we (VS Code) need to actually open the new file ( |
@DanielRosenwasser Can we investigate this for TS 3.3.5 or for 3.4? The delay currently causes a poor user experience, especially in large projects like VS Code |
@mjbvz The quick look at the log shows that the I haven't look at the code in detail for this so now looking to see how things can be improved. |
https://github.com/Microsoft/TypeScript/blob/master/src/services/getEditsForFileRename.ts#L216 this seems to be the culprit with 4727ms of 5671ms spent to check if file exists on old file. |
…orts based on file rename Fixes #29031
@DanielRosenwasser Do I need to port the fix somewhere? |
@mjbvz would VS Code adopt 3.2.5? |
Sure, depending on when 3.2.5 would ship we could either pick it up by the end of January for VS Code 1.31 or in February for VS Code 1.32 |
Never mind, misread the version as 3.3.5. No, we do not plan to pick up any more TS 3.2.x releases. |
Then nope, no porting necessary. |
Awesome work Sheetal! |
* origin/master: (1082 commits) Fix unneeded cast lints (microsoft#29383) Extracted compilerOptions setting to helper function Added codefix to enable experimentalDecorators in the user's config file Add tests for noLib with <reference lib> and bundling. Add tests for noLib with <reference lib>. Do not process library reference directives with noLib set. emit jsx type arguments Allow circular umd-merged-with-augmentation refs to resolve to the module as intended (microsoft#29335) Allow nonnull assertions in references (microsoft#29351) Accept new baselines Add regression tests Improve logic that determines when to resolve conditional types Update user baselines (microsoft#29336) Fix crash (microsoft#29333) Exclude JSDoc @extends from 'super()' checks (microsoft#29308) Fix existing test Verify that completion with new identifier location returns isNewIdentifierLocation: true Fixes microsoft#24009 Fix the failing test case There is no need to check for file presence when trying to rename imports based on file rename Fixes microsoft#29031 Fix gulp baseline-accept (microsoft#29301) ...
Coming here from microsoft/vscode#65112 via microsoft/vscode#64986. Running TS 3.3.333, this still seems to be an issue. Unfortunately I can't easily share a repro because it's a large project… |
@mjbvz Yeap, this is still an issue. In a monorepo it takes a huge amount of time to update affected files. |
If you still see this issue when using TypeScript 3.9+ in your workspace (install this extension to quickly test) please file a new issue with more information about your project |
From microsoft/vscode#65112
TypeScript Version: 3.2.2
Search Terms:
Repo
"typescript.updateImportsOnFileMove.enabled": "prompt"
setsrc/vs/base/common/paging.ts
Bug:
It takes a long time before the update imports prompt is shown. I've attached to tsserver log (the name name was
newPaging
): tsserver.log.zipLooks like there are two long running ops. Handling the project structure change:
And the
getEditsForFileRename
call:The text was updated successfully, but these errors were encountered: