MCPcopy Create free account
hub / github.com/KDE/kdevelop / benchCodeCompletion

Method benchCodeCompletion

plugins/clang/tests/bench_codecompletion.cpp:66–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void BenchCodeCompletion::benchCodeCompletion()
67{
68 QFETCH(QString, code);
69 QFETCH(KTextEditor::Cursor, position);
70
71 TestFile file(code, "cpp");
72 QVERIFY(file.parseAndWait(TopDUContext::AllDeclarationsContextsUsesAndAST, 1, 5000));
73
74 auto view = createView(file.url().toUrl());
75
76 QSignalSpy spy(m_model, &QAbstractItemModel::modelReset);
77 QBENCHMARK {
78 m_model->completionInvoked(view.get(), {position, position}, KTextEditor::CodeCompletionModel::UserInvocation);
79 do {
80 spy.wait();
81 } while (!m_model->rowCount());
82 }
83}
84
85#include "moc_bench_codecompletion.cpp"

Callers

nothing calls this directly

Calls 7

parseAndWaitMethod · 0.80
waitMethod · 0.80
toUrlMethod · 0.45
urlMethod · 0.45
completionInvokedMethod · 0.45
getMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected