Skip to content

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented May 26, 2020

closes #111

This works, but it's really slow. It takes 30 seconds minimum to update the paths. The time is entirely spent in the getEditsForFileRename of the ts language service. Is this always this slow or am I doing something wrong? Update: Bumping ts to version 3.9 did the trick. Luckily for us, the ts team did speed up that exact area drastically.

I also did manage to speed up the tests quite a bit by adding a tsconfig.json to the testfiles folder. Before that the ts services inside the tests did know about the whole project with all its ts files, which lead to the slow tests.

Simon Holthausen added 4 commits May 26, 2020 11:35
- Bumping ts version speeds up rename files
- Not refreshing the files will result in the ts service not noticing some updates which would create a bug where if you rename a file and rename it again, the ts service would have old files and rename would not update all locations.
Now that tsconfig is used, the ts service is many times faster because it only knows the files inside the test folder
@dummdidumm dummdidumm marked this pull request as ready for review May 27, 2020 08:43
@jasonlyu123
Copy link
Member

jasonlyu123 commented May 28, 2020

I notice an issue. For some reason, sometime it would apply the edit to the old path. so vscode would open a new tab with unsaved changes on a deleted file and the moved file doesn't get updated.

@dummdidumm
Copy link
Member Author

Good catch! I somehow have to tell the language service to update its document beforehand so he knows the old one no longer exists.

Simon Holthausen added 2 commits May 28, 2020 11:07
The language service might want to do edits to the old path, not the new path -> rewire it.
If there is a better solution for this, please file a PR :)
@dummdidumm dummdidumm merged commit 79abac8 into sveltejs:master May 28, 2020
@dummdidumm dummdidumm deleted the update-imports branch May 28, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support rename/move of Svelte files
2 participants