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

Selective reference resolving part1 #2764

Merged

Conversation

MDoerner
Copy link
Contributor

@MDoerner MDoerner commented Mar 1, 2017

This PR introduces selective resolving of references (by module). More precisely, only references of modules referencing a module that gets parsed are resolved.

To achieve this, I had to pull the store the unresolved declarations outside of the DeclarationFinder; they now live on the ModuleStates in a new collection separate from the real declarations. This has the added benefit that the DeclaratioFinder seen by the inspections now really see the undeclared declarations in the DeclarationFinder.

Moreover, I had to change the clean up of references to only remove references from modules whose references get resolved again.

After the changes, the reparsing time in my test project dropped from 25s to 17s when there are no changes of the code at all and to 9s if there are minor changes.

This is only part 1 and not the full story because there are still some open points.

  1. The compilation passes, namely the TypeHierarchyPass and the TypeAnnotationPass still run on all modules. (They do not add duplicates, by design.)

  2. We do not clean up properly the declarations in the modules that do not get reparsed, namely the supertypes and subtypes added in the TypeHierarchyPass do not get cleaned up. (If an implemented interface gets reparsed, e.g. because the line spacing changed, the existing supertype declaration will be out of date after the reparse. )

@retailcoder
Copy link
Member

nice, this will make UseMeaningfulNames inspection fire results for undeclared variables! 👍

@retailcoder
Copy link
Member

the reparsing time in my test project dropped from 25s to 17s when there are no changes of the code at all and to 9s if there are minor changes.

That's rather interesting..

@retailcoder retailcoder merged commit 5f9658c into rubberduck-vba:next Mar 2, 2017
@MDoerner MDoerner deleted the SelectiveReferenceResolvingPart1 branch July 2, 2017 12:45
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.

None yet

2 participants