Fast code completion

Thomas Schöps tom.schoeps at gmail.com
Tue Feb 4 14:07:41 GMT 2020


A somewhat off-topic comment to the following:

On 2/3/20 9:37 PM, Milian Wolff wrote:
> Even today we have many (valid, imo) concerns that code completion
> isn't fast enough. And this is pretty much the most important feature
> of KDevelop for me...

I might be wrong on this or it might be outdated, but when I checked
some time ago, I had the impression that KDevelop always needs to wait
for a potential current parse process for a file to finish before
invoking code completion. This seemed like it heavily increased the
latency until code completion was available in most cases (i.e., unless
code completion was triggered for an already-parsed document by pressing
Ctrl-Space somewhere, for example).

For a couple of reasons, I decided to write my own IDE (
https://github.com/puzzlepaint/cide ). Inspired by QtCreator, it keeps
two libclang translation units (with the same settings) around for each
file that is edited, and it only (alternatingly) applies parsing to one
of them at each time. This way, the other translation unit is always
available for clang_codeCompleteAt(), which seems to run near-instantly
even for translation units that are not fully up-to-date. Thus, code
completion is always fast.

If my observation was right that KDevelop does not do it this way, then
I think that this might be the #1 change that could help to drastically
reduce the code completion delay.

Best regards,
Thomas



More information about the KDevelop-devel mailing list