-
Notifications
You must be signed in to change notification settings - Fork 130
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
A flag to resolve populating index using ASTParser #2701
Conversation
@@ -19,7 +19,7 @@ | |||
import org.eclipse.jdt.core.dom.CompilationUnit; | |||
|
|||
public class ASTHolderCUInfo extends CompilationUnitElementInfo { | |||
int astLevel; | |||
public int astLevel; |
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.
Probably better to introduce a public getter method.
org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java
Show resolved
Hide resolved
org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.java
Outdated
Show resolved
Hide resolved
...eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/DOMToIndexVisitor.java
Show resolved
Hide resolved
846f8cd
to
3e5350d
Compare
I'm converting as a draft as one of the remaining TODO is critical. |
Introduce an alternative strategy to popular index from source file by building and visiting their DOM using ASTParser. This allows to make code a bit higher-level than ECJ, and allow to leverage recent changes to use alternative strategy to get DOM too. A system property SourceIndexer.DOM_BASED_INDEXER acts as a flag which when "true" will enable this DOM-strategy in place of direct ECJ parsing.
3e5350d
to
62c30c4
Compare
With latest version of everything, I couldn't reproduce the issue that triggered to commenting out the indexDocumentFromDOM in indexResolveDocument. So I think this is now ready for review. |
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.
With the commented out code now being called and the code being completely optional and distinct from regular JDT usage, I am merging.
What it does
Introduce a SourceIndexer.DOM_BASED_INDEXER flag which instead of using the ECJ-derived parser uses ASTParser to create a DOM and then crawls this DOM to populate index.
This has the benefit of:
How to test
Author checklist