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

Fix #138 Add medium level of IntelliSense / limit to the analysis depth (Related to #88). #146

Merged
merged 7 commits into from
Jun 26, 2015

Conversation

kant2002
Copy link
Contributor

Limit depth analysys to relative paths which contains only 2 node_modules. This should be sufficient enough to capture
a) Capture API of the root package
b) Capture API of the dependencies. This is obiviously the must to analyze (1 node_modules)
c) Capture API of subdependencies (2 node_modules). This is also the must, since a lot of packages are wrapper/glue for another library. For example using gulp-typescript require that gulp-typescript should be parsed (level b) and typescript should be parsed (level c) since typescritp provide some config options for gulp-typescript.

Related to #88
#138 Added Medium level of Intellisense. This level now same as Full level, but limit analysis depth to the 2 nested modules depth. Full mode is now has limit to 4 modules depth which I almost sure practical enough, but could be increased if needed. Low level is analyse 1 level depth.

Limit depth analysys to relative paths which contains only 2 node_modules. This should be sufficient enough to capture
a) Capture API of the root package
b) Capture API of the dependencies. This is obiviously the must to analyze (1 node_modules)
c) Capture API of subdependencies (2 node_modules). This is also the must, since a lot of packages are wrapper/glue for another library. For example using gulp-typescript require that gulp-typescript should be parsed (level b) and typescript should be parsed (level c) since typescritp provide some config options for gulp-typescript.
@msftclas
Copy link

Hi @kant2002, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@kant2002
Copy link
Contributor Author

I add the configuration option for the Middle level of Intellisense (#138). Right now analysis level not configurable, but if you think this would be valuable, I could put additional config option for that.

@mousetraps
Copy link
Contributor

I'll take a look at this PR when I've had more sleep 😃. But lets make this configurable in the per-project setting as well - it shouldn't override the users general setting, but rather serve as an additional filter. This would enable users who are sharing a project to figure out good project-specific settings rather than relying on every single person on the team to use the same defaults. Because ultimately this is a project-specific perf issue.

For the sake of UI simplicity, Let's hold off on making it configurable from general project settings unless/until we start getting requests for it.

<value>154, 21</value>
</data>
<data name="_mediumIntelliSenseRadioButton.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

Check the tab index here. WinForms is annoying in that it won't automatically update all the controls on the page.

@mousetraps
Copy link
Contributor

Left some comments, minor tweaks for the most part. @DinoV, it would be great to get your eyes on this as well.

while (index != -1) {
nestedModulesCount++;
if (nestedModulesCount > limits.NestedModulesLimit) {
continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

the check is nested now, so continue is going to continue the while loop, not the outer for loop, resulting an in infinite loop after the limit is exceeded.

One solution is the refactor the while loop and relevant variables out into its own private method, say "CheckExceedsNestedModulesLimit", and return true instead of continuing, false otherwise. Then...

if (!CheckExceedsNestedModulesLimit(path, limits)) { 
    files.Add(new AnalysisFile(file, File.ReadAllText(file)));
}

@mousetraps
Copy link
Contributor

Hey there, just checking in to see if you have any questions. It would be great to get this change into the next release. 😃

@kant2002
Copy link
Contributor Author

kant2002 commented Jun 9, 2015

Hi, was side-tracked on the main work. Will take a look at the comments from @DinoV later today, or tomorrow

@mousetraps
Copy link
Contributor

Yeah, no worries - it's totally okay to have a life outside NTVS 😉. This feature is super impactful, though, so unlike cookie dough... the more bake time, the better.

@objelke
Copy link

objelke commented Jun 18, 2015

This feature is super impactful, though

oh yes, we have a good amount of developers waiting... (the homebrew patch is fine but it would be so much nicer to get rid of it)
If I can assist, most happy to do so. Let me know.

@kant2002
Copy link
Contributor Author

Thanks all for waiting, I send additional changes which should address @DinoV comment that I don't place fix in the correct place.

return false;
}

startIndex = index + 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be startIndex = index + "node_modules".Length since you already know you've seen node_modules at index

@mousetraps
Copy link
Contributor

Awesome, thanks! Added some more comments, so lgtm after that. @DinoV and @objelke, feel free to jump in if you have anything else to add.

kant2002 added 2 commits June 19, 2015 10:23
1. Use limit settings instead of constants.
2. Removed constants, moved explanation to the property initialization
3. Performe dependency depth check as last check, since it is slowest one.
//
// 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.
// </remarks>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: there's an end tag, but no opening tag here. I don't believe would actually do anything here, so the tag should just be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just remove it.

@mousetraps
Copy link
Contributor

Awesome, looks great! super nitpicky comment, but overall 👍

@mousetraps mousetraps changed the title Add the limit to the analysis depth (Related to #88). Fix #138 Add medium level of IntelliSense / limit to the analysis depth (Related to #88). Jun 26, 2015
mousetraps added a commit that referenced this pull request Jun 26, 2015
Fix #138 Add medium level of IntelliSense / limit to the analysis depth (Related to #88).

Limit depth analysys to relative paths which contains only 2 node_modules. This should be sufficient enough to capture
a) Capture API of the root package
b) Capture API of the dependencies. This is obiviously the must to analyze (1 node_modules)
c) Capture API of subdependencies (2 node_modules). This is also the must, since a lot of packages are wrapper/glue for another library. For example using gulp-typescript require that gulp-typescript should be parsed (level b) and typescript should be parsed (level c) since typescritp provide some config options for gulp-typescript.

Related to #88 

#138 Added Medium level of Intellisense. This level now same as Full level, but limit analysis depth to the 2 nested modules depth. Full mode is now has limit to 4 modules depth which I almost sure practical enough, but could be increased if needed. Low level is analyse 1 level depth.
@mousetraps mousetraps merged commit 1366e22 into microsoft:master Jun 26, 2015
@kant2002 kant2002 deleted the high_mem branch June 26, 2015 03:11
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.

5 participants