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
"Updating imports" happens unnecessarily #641
Comments
You could also import non-ts/js files into Svelte files I think.
How to know if the file is not imported yet if you don't scan the other files? -> this is not possible unfortunately.
That is a good idea!
Yes this would certainly help for point 1. General note: To update the imports, we just forward the request to our TypeScript language service which then does all the work of finding out what needs to be changed. I'm curious to know whether or not the update times are equally long when you open up your project, open a TS file and NOT a Svelte file (so the Svelte extension is not triggered/started) and then do a file rename of a) a TS file b) a sql file. |
Following your instructions,
Regarding my 4 expected outcomes, I agree that it'd be hard to know what files to trigger updates for. But if we combine all those points, we could have a user-configurable list of file types to look out for and then default it to something common. Also, on the issue of knowing whether the file is imported or not, if that feature is split up into a) check for imports and b) prompt the user for updates to imports, then hopefully there might a little less work to do in the first step. |
In the meantime you can disable this completely by setting https://github.com/sveltejs/language-tools/tree/master/packages/svelte-vscode#sveltepluginsvelterenameenable to |
Great, thanks for the pointer @dummdidumm! |
This will now only search for imports to update when |
The TS plugin and the Svelte extension want to update the same locations after a file move/rename in some cases; prevent that sveltejs#641
I saw this in Svelte 4, copying an existing .svelte file and renaming it from copy to another name caused a never ending "Updating Imports..." (needed to reload the editor to get rid of it) |
@henrikvilhelmberglund I create a new issue to track it #2065 |
Describe the bug
I work on a project containing different types of files (mostly *.ts, *.sql, *.svelte, *.json, *.yml, *.md). I observe the following two issues:
I have about 2000 files in the project and only 100 of them are *.svelte files.
To Reproduce
src/
directory of any type, try withfoo.yml
.bar.yml
). Keep an eye on the info/status toolbar at the bottom of VS Code, you'll see "Updating imports" quickly show and then disappear.Expected behavior
Screenshots
N/A
System (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: