S
S
Stepan Valerich2019-06-16 13:31:21
Algorithms
Stepan Valerich, 2019-06-16 13:31:21

How does smart code completion work?

Hello!
Interested in the code completion algorithm based on knowledge of functions and statistics on the sequence of using functions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Koryukov, 2019-06-16
@MadridianFox

There are two extremes in autocompletion.
Option one - just break the text into words, add the keywords of the current language to the list and somehow suggest what the programmer began to type.
Option two - we perform an honest analysis of the code, just like the compiler / interpreter does, and depending on the context in which the word is typed, we suggest only possible variants. Well, for example, if we are typing a class definition, then after the name there can be either extends or implements. If you typed extends, then the name of the class will definitely be further, and not the final one.
Each code editor uses its own approach, and it is not at all necessary that exactly one of the two, it can be a mixture in any proportions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question