Search code examples
eclipse-jdt

Why Eclipse JDT does not have a global symbol search


In the CDT there is an "Open Element" to search for global symbols, but not in JDT.
only uses "Java search" to search, obviously not very convenient, why JDT does not provide a function like this?


Solution

  • Anywhere in Eclipse you can use the general File Search to search for words regardless their position in text. This search can be limited to *.java files; also the Whole word option may be relevant for this question.

    If you want more precise search results, JDT offers language-aware search, but for this added precision you need to specify the kind of symbol you are interested in (Search For). Without specifying the kind, search would be very similar to plain text search.

    Both CDT and JDT use an index for search. The CDT index is said to be faster, because it is more complete, whereas JDT search needs to operate in two phases: index based match candidates plus exact matching using resolved AST. In fact, efforts have started, to port the concept of the more complete CDT index also to JDT for improved search speed. As of Oxygen, however, this effort has not been completed.

    Anyone seeing substantial benefit in allowing to search for more than one kind at a time is invited to chime in at Bug 221081.