"Updating imports" happens unnecessarily
See original GitHub issueDescribe 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:
- Whenever I rename a file, even a .sql file for instance, the Svelte plugin tries to update imports in *.svelte files.
- A Node.js process is forked to update imports and that runs at 100% CPU (or more). I often have to kill the process, it doesn’t stop on its own.
I have about 2000 files in the project and only 100 of them are *.svelte files.
To Reproduce
- Clone the template project https://github.com/sveltejs/template
- Open it in VSCode. Ensure you have the Svelte for VSCode plugin installed.
- Add a file in the
src/
directory of any type, try withfoo.yml
. - Rename the file (e.g. to
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
- That renaming a non-svelte (or ts or js) file should not trigger updating of imports in svelte files.
- That renaming a file that’s not used anywhere does not trigger updating of imports (it’s not imported yet)
- That imports are not automatically updated, rather, I’m asked if I’d like to update imports. This is the current behaviour in VSCode itself.
- Ideally, I get to configure which file types should trigger updating of imports in svelte files.
Screenshots N/A
System (please complete the following information):
- OS: Ubuntu Linux 20.04
- IDE: VSCode v1.50.1
- Plugin/Package: Svelte for VSCode v102.3.0
Additional context N/A
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Any reason to clean up unused imports in Java, other than ...
There was an improper import that a developer had used and abandoned (they used the class, auto-imported it, and then realized it was...
Read more >Unnecessary Imports: Be careful what you import
In this cautionary Python tutorial you will learn how to avoide and identify unnecessary Python modules. Avoid wasting memory and read this ...
Read more >Troubleshooting Contact Imports
Each time you import contacts in Mailchimp, we look for duplicates, bounces, and unsubscribes, as well as incorrect file formats and syntax errors....
Read more >NetSuite Applications Suite - Line Item Updates ...
An error is returned if the import cannot determine which lines to update. This error occurs if there are two existing lines with...
Read more >Importing Packages in Go
You may want to change a package name if you have a local package already named the same as a third party package...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This will now only search for imports to update when
.ts
,.js
,.svelte
or.json
file paths are changed. What’s left to do is the “update imports?”-question.Great, thanks for the pointer @dummdidumm!