Skip to content

IntelliSense will crash in large projects that use a lot of node modules #47327

@RonanQuigley

Description

@RonanQuigley
  • VSCode Version: 1.22.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. clone the following repo and navigate to the test>back-end>routes.test.js file:
    git clone https://github.com/RonanQuigley/vscode-intellisense-bug .
  2. run yarn to install the node_modules folder. You do not need to execute any script to see this problem.
  3. Adjust the import path as demonstrated in the gif below. Notice that aside from being slow (around 1s to update a path, intellisense eventually hangs on 'Loading...' and won't work without an update.

intellisense

I've tried to replicate this with a barebones project i.e. just two files but it never happens. I've also managed to narrow it down to the node_modules folder. Intellisense, when scanning that folder, will crash if the project has a lot of modules. Just before the crash I've consistently have had this sort of cpu spike:

spike

If you delete the node modules folder, the issue is gone. If you reduce the number of modules, whilst intellisense is a bit slower, the issue is also gone. If you use require instead of import, the issue is also there. I tried to see if it was a specific module causing it, but my tests have shown that it's not the case. It's just the sheer number of modules being used.

Is there intellisense logging that I can provide that would help? The only current workaround is to restart vscode, which if like me, you encounter this issue incessantly is a complete pain in the butt to deal with.

There's loads of other files in this project; I've just left them in in case there's something contributing to the issue that perhaps I'm missing. So whilst I have tried to minimise the project to the least amount of files, it only happens in larger setups unfortunately.

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

javascriptJavaScript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions