dc.description.abstracten |
Code completion is one of the essential features of any IDE and it significantly im-
proves the developer experience and productivity. Good code completion can both
speed up the development process, as well as aid the developer in API exploration.
On the other hand, having a slow or inaccurate completion can be very cumbersome.
Thus, it is important to find a way to make it as effective as possible.
The current implementation of code completion in the Pharo IDE is based on the
abstract syntax tree (AST) of source code. The AST allows us to learn the semantic
role and the kind of tokens (e.g. class name, method name, literal, et cetera) and
to suggest contextually relevant completions. However, the current implementation
has no efficient way to sort the completion candidates, which means that sometimes
the user must scroll through a long list of proposed completions to find the one that
they need.
In this work, I study how code completion can be improved by sorting comple-
tions in such a way that most frequently used tokens appear first. To that end, I
implement a sorting plugin based on the n-gram language model.
I use quantitative and qualitative evaluation techniques to compare the perfor-
mance of the n-gram (unigram and bigram) and alphabetic sorters. As a result of the
evaluation, the unigram sorter was shown to have the best performance.
The sorting strategies implemented are part of a Pharo IDE plugin. It is open
source and is available at https://github.com/myroslavarm/CompletionSorting. |
uk |