Re: Fast code completion

Milian Wolff <[email protected]>
Newsgroups gmane.comp.kde.devel.kdevelop
Message-ID <3456185.MHq7AAxBmi@agathebauer>
On Dienstag, 4. Februar 2020 15:07:41 CET Thomas Schöps wrote:
> 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).

Cool, thanks for sharing this trick. Sounds like this could help a lot indeed, 
at the cost of increased resource consumption. But I do indeed think this 
should be done for KDevelop too - definitely something for me to try out!

> 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.

Cool project :) Have fun! And while I somewhat agree with Kevin, I do see why 
one would potentially want to start off with a clean state instead of trying 
to grog KDevelop. Yet one big suggestion from my side is definitely to at 
least reuse KTextEditor. That also works on Windows and Mac, if that matters, 
and will instantly give you a really good editor component. Then you can 
concentrate on the rest.

> 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.

Indeed, thanks!

-- 
Milian Wolff
[email protected]
http://milianw.de
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEezawi1aUvUGg3A1+8zYW/HGdOX8FAl49zTQACgkQ8zYW/HGd
OX/WJg//QOLrg2ahcaavxyNDOl+V9VapRdlUJW59qmqCKwhi+pXSpUXS8rYxDdXf
x5MZ+4PL1Fs0ruaOsmk74WsT2pWE9dh+LTXMSg6kSgYN2mtWGX/l+QBXNAXCimEK
In/W3XExz0qbuDtQdfBsiV8DPUNCk563F4Yw0Pjw3HAMvxcTsde1YoQ5imeCqk+0
LxXKedvelUGlhsnP9h2sv8JphmBWnzUREuWGHHgJbpNsibQJAn+afIM6hAY6OOsg
0oBvPnq/evSWBiwgUNNuzsxRwv0EvlByan0WZXkOdfeyD5F3JwqJygb9EZdQqkC3
tmeRnzow87KLG2/0k2Mmv3ROGs0DYAqpcxdYfZfncn83xHsSbBsV9R1/5tlUdaAf
MJQ7t9qCTl17kS9CA43wGVxoFsEzU1I3lfHnnM91PXaWyXuO9Sv1WCzOIK2OAyH8
MnlPSxf+ZtbfmfbmMAjKBkGzSiPvVq0YfXJpAGLIEhxh49fMCkLFUvkTOg1sC9BS
tpyeh6QFQID2wRMxkYIYg6/yRboR0oTtHcp+odqClzmLcPg4MmtW2uii9w5PKTtc
RTk/DnJOahJNiA9KV3s8GbPzQlXbpJ9r4fzArCy/qVFkMJ00KamYmZaa9rLoZO1k
AehIZlpPX8/9ZhKu5AvFXV560I+hoHvvEGuy0Fi5VjWUAk61BqE=
=qrSy
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.