I am developing a code editor for html, css, php, js in Qt. I need that after each change by the user of the code in the text field, the program runs through the data and displays those that begin with what the user entered keywords / functions. I have a list of php function prototypes. Tell me, please, how best to organize the search for the right words in this huge amount of information? After all, it is necessary that all this work very quickly. I look towards databases. Then I will need to parse all the stubs with github'a (link above) and write them to the database. Or is there a better way? What do smart people do in such cases?

The attached image is what I want to get in the end.

vs - screenshot

  • smart people make wood, spell. or keep the list sorted and use binary search. - KoVadim
  • binary search is long. I would recommend boron or the Aho-Korasik algorithm. - pavel
  • one
    @KoVadim boron is from the word dictionary tree) And about Aho-Corasica there is more cunning. It allows you to build a finite state machine for finding the occurrences of all the substrings. It seems to be exactly what is needed. Aho-Korasik is a modernized boron. - pavel
  • one
    In this repository there are files, from the functions of which the "body" was deleted - so that they would be smaller and easier to parse. Where do the editors take all of this? Two options are either hardcodes (that is, they generate a list with pens), or they write a full-fledged parser that does everything itself. - KoVadim
  • one
    Hardcode - yes, manually. And the parser is a source code parser. And if they change, then the list changes. - KoVadim

0