Group completion requests and only handle the last one

Authored by mwolff on Apr 17 2018, 10:07 PM.

Description

Group completion requests and only handle the last one

Summary:
I noticed that we sometimes wait quite long on code completion
requests, especially when editing header files. The edit operation
in a header invalidates the preamble, so reparsing will always take
quite some time. Nothing we can do about that, really. But at least
we can make sure we don't do work for naught:

The old code just emitted signals whenever code completion is invoked.
This can happen multiple times while we are editing the header. Since
the computation takes time, the subsequent completion requests pile
up and will all be handled eventually. If you are then impatient and
go to a different file, we will still go through all requests even
though they are not interesting anymore.

This patch groups the completion requests together with a simple
timer to ensure we only handle the last request once the current
completion job has finished.

Subscribers: kdevelop-devel

Differential Revision: https://phabricator.kde.org/D12298

Details

Committed
mwolffApr 27 2018, 10:24 AM
Differential Revision
D12298: Group completion requests and only handle the last one
Parents
R32:967f42fd37bf: Merge remote-tracking branch 'origin/5.2'
Branches
Unknown
Tags
Unknown