D16326: Replace leading typed text when completing function implementation

Milian Wolff noreply at phabricator.kde.org
Sun Oct 21 19:15:02 BST 2018


mwolff added a comment.


  In D16326#346194 <https://phabricator.kde.org/D16326#346194>, @amhndu wrote:
  
  > Added tests in testCompleteFunction, which already has some implements-completion
  >  tests. Should I move them to a different test, something like testImplementExecute
  >  in a different patch or this one ?
  >
  > Completion tests are also broken, crashing after executing a single test case
  >  because of a delayed connection, triggering the slot only after the document is closed.
  >  As a workaround, I've used
  >
  >   diff --git a/plugins/clang/tests/codecompletiontestbase.cpp b/plugins/clang/tests/codecompletiontestbase.cpp
  >   index 5b351d0d27..282f7da36e 100644
  >   --- a/plugins/clang/tests/codecompletiontestbase.cpp
  >   +++ b/plugins/clang/tests/codecompletiontestbase.cpp
  >   @@ -70,6 +70,7 @@ void CodeCompletionTestBase::initTestCase()
  >        m_projectController = new TestProjectController(core);
  >        core->setProjectController(m_projectController);
  >        ICore::self()->documentController()->closeAllDocuments();
  >   +    QObject::disconnect(ICore::self()->documentController(), nullptr, nullptr, nullptr);
  >   
  >        ClangSettingsManager::self()->m_enableTesting = true;
  >    }
  >
  >
  > Which still has a crash, but only at the very end after executing everything.
  
  
  I've fixed both issues with:
  
    commit 8f9f8d1c4452f8d9291ae530f3720511fd203aef
    Author: Milian Wolff <mail at milianw.de>
    Date:   Sun Oct 21 20:12:37 2018 +0200
    
        Fix crashes when document gets destroyed directly after load
        
        This fixes the clang code completion unit test, which used to
        crash on exit since the event loop wasn't run between loading
        a document and destroying it again.
        
        To guard against this, we need to jump through a QPointer hoop,
        which requires some lambda boiler plate but otherwise isn't too bad.
  
  This should work for all unit tests and doesn't require such a hackish disconnect.

REPOSITORY
  R32 KDevelop

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

To: amhndu, #kdevelop, mwolff
Cc: mwolff, apol, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20181021/4cbc19e2/attachment-0001.html>


More information about the KDevelop-devel mailing list