In kio/autotests/clipboardupdatertest.h add a method void foo() after all other test methods. In the .cpp file, go to the first line after the closing '}' of testPasteAfterRenameFiles() and request completion, it will offer (after a bit of time which I find too long) * implement void ClipboardUpdaterTest::foo() [as expected] Cancel this popup, insert one blank line, call completion again -> it doesn't offer this anymore! Reproducible: Always Expected Results: It shouldn't matter if I'm right under a '}' or not.
I've seen this behavior as well. I guess it's related to us not triggering a reparse after whitespace-only changes. The clang TU is then probably stale and thinks we are completing in a different context. We should also look at the performance and figure out why it takes so long.
Git commit 83fb88ec7b14b0f128db6c86b7078f3f51646aa1 by Milian Wolff. Committed on 07/02/2016 at 21:37. Pushed by mwolff into branch '5.0'. Also offer to implement function when in line of next function. This fixes a bug where putting the cursor at the start of a line where another function is defined, no implementations are offered. This also workarounds the common case for bug 358521, where the real cause is that the TU is not properly updated. Thus the cursor will point to the old position where a function was and then no offers where given. M +2 -0 languages/clang/codecompletion/completionhelper.cpp M +4 -0 languages/clang/tests/test_codecompletion.cpp http://commits.kde.org/kdevelop/83fb88ec7b14b0f128db6c86b7078f3f51646aa1
Git commit a034f76041aea5f1ade48759a17e42959833b62e by Milian Wolff. Committed on 08/02/2016 at 08:05. Pushed by mwolff into branch '5.0'. Add test case for broken implementation helper after edit operation. M +32 -1 languages/clang/tests/test_codecompletion.cpp M +1 -0 languages/clang/tests/test_codecompletion.h http://commits.kde.org/kdevelop/a034f76041aea5f1ade48759a17e42959833b62e
The issue is fixed (more or less a side-effect of 0931fe88180d1); the test still fails though since it does not wait for the update.