Skip to content
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

javascript.updateImportsOnFileMove.enabled will destroy your project in some cases #53754

Closed
mschipperheyn opened this issue Jul 6, 2018 · 3 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@mschipperheyn
Copy link

When I was prompted if I always wanted to always automatically update the references if I moved a file, I thought nothing of it and clicked yes. Imagine my surprise when vscode opened up hundreds of files in my project and started inserting references to some files far outside of the project space. My cpu went into overdrive

Killing vscode didn't help. It started right up doing it when I restarted. Scary. In the end, manually editing the settings file ("javascript.updateImportsOnFileMove.enabled": "always => never") proved the way to turn it off.

  • VSCode Version: 1.25.0
  • OS Version: Mac High Sierra

Steps to Reproduce:

I don't know and I don't care. I will never use this function again.
As far as I can tell most, perhaps all, of the affected imports had an @ in them, e.g. "@lingui/react": "2.0.7"

This should never have happened. Vscode should not process every file in the project to check for file links and change them, only files you move (as advertised). Also it should imho never blindly start importing references outside of the project directory. That makes no sense to me.

My assumption is that it looked for the node_modules/package file up the tree for some reason, I assume because of the @ sign, but not sure.

@vscodebot vscodebot bot added the new release label Jul 6, 2018
@mjbvz mjbvz self-assigned this Jul 6, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Jul 6, 2018

Duplicate of microsoft/TypeScript#24914

The next VS Code insiders build picks up TypeScript 3.0. Try that or manually install typescript@next by following these instructions. Let me know if you run into the issue again after updating

@mjbvz mjbvz closed this as completed Jul 6, 2018
@mjbvz mjbvz added typescript Typescript support issues javascript JavaScript support issues *duplicate Issue identified as a duplicate of another issue(s) upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Jul 6, 2018
@petejodo
Copy link

petejodo commented Jul 6, 2018

This just happened to me and vscode is basically unusable for me now. Every time I try to boot vscode, it freezes since I accidentally closed vscode when trying to close all the tabs that were updated (which included a very large number of files from node_modules) and so when booting, it hangs trying to reopen all those files again from what I assume is some cache of unsaved data.

Where does the data for tracking what files are open live and is it safe to remove?

@Shenmin-Z
Copy link

I had the same issue and it is really annoying. If you are using typescript, notice that there is another option:

typescript.updateImportsOnFileMove.enabled

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants