Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] Understanding JDT Indexing

Hi Mads,

From scanning your document it seems you're doing good research, cool.
Yes, this will be valuable to keep online, once it's done.

I'm not familiar with every detail of indexing. but let me try to
answer a crucial questions in the document:
  "It is unclear to me where it stores the line number/char offset of
   the words. Or if it even does."

The "bad news" is: the index does not store positions inside a document.
I'm afraid if you want to understand the full story of searching you'll
have to dig into one more pretty complex class: the MatchLocator.
This is where a PossibleMatch (referring to a SearchDocument etc) is
mapped to an IJavaElement, involving the compiler, various
ParternLocators etc., collecting a MatchingNodeSet which is based on
ASTNodes (from the internal compiler AST) and finally passing the
result to a SearchRequestor.

HTH,
Stephan


I'm about to start working on my masters thesis in collaboration with Typesafe which will be about implementing semantic search for the Scala plugin for Eclipse. To gain
some inspiration and a better understanding of the challenges I'm currently studying how the JDT Search for Java works.

I've written down how I believe the indexing works here https://docs.google.com/document/d/1okvSn62IP-cuzdANd2fHgrtjvJuZMefS8y3YDEPpLp8/edit

It would be really great if someone who understand exactly how it works could give it a read and see if I got it right.

If you find that this document is accurate we could talk about putting it online somewhere to help the next developer who comes along and
wants to understand how it works :)

Cheers,
Mads Hartmann Jensen
_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-core-dev



Back to the top