-
Notifications
You must be signed in to change notification settings - Fork 355
Fix #138 Add medium level of IntelliSense / limit to the analysis depth (Related to #88). #146
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fd99bd7
Add the limit to the analysis depth.
kant2002 cf70b28
Add medium level analysis for the Intellisense.
kant2002 8ec3623
Fixes according to the code review
kant2002 fd7da14
Add limitation to the node analysis not only in tests, as originally,…
kant2002 1ac005c
Fixes acoording to code review.
kant2002 ac331e4
Move function for checking depth limit to AnalysisLimit
kant2002 74dffd6
Removed not needed comment tag
kant2002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ namespace Microsoft.NodejsTools.Options { | |
enum AnalysisLevel { | ||
None, | ||
Low, | ||
Medium, | ||
High | ||
} | ||
} |
18 changes: 14 additions & 4 deletions
18
Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsControl.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to mess with the high analysis limits here? How did you decide on 4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason for 4 following - I try to be very practical about numbers.
For small applications this number more then enough, and they don't have any issues dealing with some potential errors in Intellisense.
But if we have large application with Full setting, then VS Tools for Node.JS as a product immediately became unusable for that users.
I try to imagine dependency tree which exceed this 4 depth limit. Here the examples of trees about which I thought:
Example 1
Level 0 - Large system. Some code should use properties of the object on level 4 here.
Level 1 - Subsystem - pass data from level 4
Level 2 - Internal dependency for company - Do some work and pass data to level 1
Level 3 - Framework on top of which created Internal dependency.
Level 4 - Dependency of the framework. Objects from here still should be available.
Level 5 - Dependency of the framework provide some usefull primitive which would be used very often on the level of whole system. Hmmm.
Example 2 (reason why I could increase to 5)
Level 0 - Large system. Some code should use properties of the object on level 4 here.
Level 1 - Subsystem - pass data from level 4
Level 2 - Internal dependency for company - Wrap access to internal library and perform business logic. Do some work and pass data to level 1
Level 3 - Internal library which wrap access to API.
Level 4 - Http library.
Level 5 - Promise Polyfill.
All these examples are highly speculative and I specifically try to create such deep level. If you develop on windows with such deep level you already close to your limit, your maximum is probably 10.
If you have such deep structure already, chances that you have more then one such deep dependency is very high, and thus we just increase time for loading solution, loading analysis file and increase memory consumption without any practical benefits.
From my point of view practical benefits much better, and better have good and usable product with 90% working intellisense.
Or we just have 2 options: Medium and None without Full being usable by anyone on the large projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for the detailed explanation. Logically it makes sense to me, though Dino has the most familiarity on this and what the edge cases might be, so it'll be great if he can chime in here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing the change that actually limits this in the product? AnalysisTests\AnalysisFile will limit it when we run the tests, but won't do anything when running inside of VS.
Personally I would suggest not putting this in AnalysisLimits, and not having the analyzer actually be aware of this at all. The AnalysisLimits class is really used for limits on things when we're analyzing. But in this case we actually just don't want to analyze these files at all. Which means we also want to avoid parsing them entirely too.
Therefore I think the correct spot to put this limit in would be in NodejsFileNode.ShouldAnalyze. If you return false from there then we won't even bother parsing the file which should give the best performance gain.