D12298: Group completion requests and only handle the last one

Milian Wolff noreply at phabricator.kde.org
Tue Apr 17 22:23:01 UTC 2018


mwolff created this revision.
Restricted Application added a subscriber: kdevelop-devel.
mwolff requested review of this revision.

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

REPOSITORY
  R32 KDevelop

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D12298

AFFECTED FILES
  plugins/clang/codecompletion/model.cpp

To: mwolff
Cc: kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180417/3c8d04c3/attachment-0001.html>


More information about the KDevelop-devel mailing list