How to display Eclipse IDE quick pick suggestions?

I am wondering how eclipse ide can display you suggestions and quickly display results. I work with a huge code base with 1000 and 1000 classes, and I thought there would be some lag in offering misspelt class names, for example.

How is he looking for possible offers? Why so fast? Does it describe all the possible situations that can be quickly accessed?

Just what interests me because I use eclipse every day :) Greetings

+6
source share
3 answers

The same thing that Google can search in billions of records, or a text indexing system, such as Lucene , is running. These systems first index the text to search, and it can be quite long; you can see it when you first import a project into Eclipse, in order to index everything, it takes a lot of time in the background.

Once the data is indexed, it can be searched with incredible speed. I believe that the complexity of such a search is O (log n), that is, it takes 1 unit of time to search among 10 items, 2 for 100 items, 3 for 1000 items, 6 per million, 9 per one billion, etc. .

For such an efficient algorithm, the data size is of little importance.

+9
source

Here is an excerpt from JDT Core (Java development tools):

JDT Core is the Java framework for the Java IDE. It includes:

...

  • Indexed search infrastructure used for search, code help, type hierarchy calculation, and refactoring. The Java search engine can find exact matches either in the sources or in the binary files.
+1
source

There is probably a K-gram index for a quick prefix search. Or maybe a Trie data structure.

0
source

Source: https://habr.com/ru/post/902554/


All Articles