Skip to content

#566 No IntelliSense after npm install with a new project#586

Merged
mousetraps merged 1 commit intomicrosoft:masterfrom
mousetraps:i566
Nov 12, 2015
Merged

#566 No IntelliSense after npm install with a new project#586
mousetraps merged 1 commit intomicrosoft:masterfrom
mousetraps:i566

Conversation

@mousetraps
Copy link
Copy Markdown
Contributor

This was due to a race condition with the delayed analysis queue. In
particular, there were some cases where the NodejsFileNode was created
(and therefore an analysis unit enqueued) after the delayed analysis queue
had already finished processing existing entries. This fix simplifies the
logic to make it more deterministic. In particular, get rid of the
separate filewatcher altogether, add entries to the delayed analysis queue
whenever new NodejsFileNodes are created, and restart the idle
node_modules timer after enqueuing the unit.

fix #566

This was due to a race condition with the delayed analysis queue. In
particular, there were some cases where the NodejsFileNode was created
(and therefore an analysis unit enqueued) after the delayed analysis queue
had already finished processing existing entries. This fix simplifies the
logic to make it more deterministic. In particular, get rid of the
separate filewatcher altogether, add entries to the delayed analysis queue
whenever new NodejsFileNodes are created, and restart the idle
node_modules timer after enqueuing the unit.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't create a new timer each time, but reset/start the existing timer... they are not cheap.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not getting created each time - this only happens when ModulesNode is null, which is when the project hasn't been loaded yet. The timer is reset here: https://github.com/mousetraps/nodejstools/blob/i566/Nodejs/Product/Nodejs/Project/NodejsProjectNode.cs#L113

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, the things you miss when only looking at the diff...

@paulvanbrenk
Copy link
Copy Markdown
Contributor

LGTM, the timer creation can be pushed to a future release.

@billti
Copy link
Copy Markdown
Member

billti commented Nov 12, 2015

If this has been validated, then 👍. Thanks!

mousetraps added a commit that referenced this pull request Nov 12, 2015
#566 No IntelliSense after npm install with a new project
@mousetraps mousetraps merged commit b2f3b52 into microsoft:master Nov 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No intellisense on Express after npm install with a new project

4 participants