Skip to content
Commit e48c6265 authored by Milian Wolff's avatar Milian Wolff
Browse files

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
parent 967f42fd
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment