question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Updating imports" happens unnecessarily

See original GitHub issue

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:

  1. Whenever I rename a file, even a .sql file for instance, the Svelte plugin tries to update imports in *.svelte files.
  2. 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

  1. Clone the template project https://github.com/sveltejs/template
  2. Open it in VSCode. Ensure you have the Svelte for VSCode plugin installed.
  3. Add a file in the src/ directory of any type, try with foo.yml.
  4. 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

  1. That renaming a non-svelte (or ts or js) file should not trigger updating of imports in svelte files.
  2. That renaming a file that’s not used anywhere does not trigger updating of imports (it’s not imported yet)
  3. 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.
  4. 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:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dummdidummcommented, Dec 11, 2020

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.

0reactions
joelmukuthucommented, Nov 2, 2020

Great, thanks for the pointer @dummdidumm!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found