aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangcodemodel
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2024-03-06 15:10:15 +0100
committerEike Ziller <eike.ziller@qt.io>2024-03-06 15:10:15 +0100
commit8abc95331f1dddafb07c691857d3519829acb4ef (patch)
tree4b7b3f506917028540aa3df17d27d4534c8857c3 /src/plugins/clangcodemodel
parentdb5ac2dc15f0ac607c03416e538ae2ffc5482467 (diff)
parent7b8f274b9e3956a2e8668f932ee9717f96568678 (diff)
Merge remote-tracking branch 'origin/13.0'
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs src/plugins/cppeditor/cppcodemodelsettings.cpp src/plugins/cppeditor/cppcodemodelsettings.h Change-Id: I54937c39b06897a72a105e4e0a8b5f8a76c38e26
Diffstat (limited to 'src/plugins/clangcodemodel')
-rw-r--r--src/plugins/clangcodemodel/clangdsemantichighlighting.cpp4
-rw-r--r--src/plugins/clangcodemodel/clangmodelmanagersupport.cpp5
-rw-r--r--src/plugins/clangcodemodel/test/clangdtests.cpp10
3 files changed, 10 insertions, 9 deletions
diff --git a/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp b/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp
index dd63565bd56..c5bc3d72354 100644
--- a/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp
+++ b/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp
@@ -386,8 +386,6 @@ void doSemanticHighlighting(
}
if (isOutputParameter(token))
styles.mixinStyles.push_back(C_OUTPUT_ARGUMENT);
- qCDebug(clangdLogHighlight) << "adding highlighting result"
- << token.line << token.column << token.length << int(styles.mainStyle);
return HighlightingResult(token.line, token.column, token.length, styles);
};
@@ -420,6 +418,8 @@ void doSemanticHighlighting(
}
QList<Range> virtualRanges;
for (const HighlightingResult &r : results) {
+ qCDebug(clangdLogHighlight)
+ << '\t' << r.line << r.column << r.length << int(r.textStyles.mainStyle);
if (r.textStyles.mainStyle != C_VIRTUAL_METHOD)
continue;
const Position startPos(r.line - 1, r.column - 1);
diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
index c034ad82f6c..3d8965248f8 100644
--- a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
+++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
@@ -798,11 +798,6 @@ void ClangModelManagerSupport::watchForExternalChanges()
if (!LanguageClientManager::hasClients<ClangdClient>())
return;
for (const FilePath &file : files) {
- if (TextEditor::TextDocument::textDocumentForFilePath(file)) {
- // if we have a document for that file we should receive the content
- // change via the document signals
- continue;
- }
const ProjectFile::Kind kind = ProjectFile::classify(file.toString());
if (!ProjectFile::isSource(kind) && !ProjectFile::isHeader(kind))
continue;
diff --git a/src/plugins/clangcodemodel/test/clangdtests.cpp b/src/plugins/clangcodemodel/test/clangdtests.cpp
index 1edec4c2905..bfe7ea95368 100644
--- a/src/plugins/clangcodemodel/test/clangdtests.cpp
+++ b/src/plugins/clangcodemodel/test/clangdtests.cpp
@@ -2207,15 +2207,21 @@ void ClangdTestExternalChanges::test()
QVERIFY(curDoc->marks().isEmpty());
// Now trigger an external change in an open, but not currently visible file and
- // verify that we get diagnostics in the current editor.
+ // verify that we get a new client and diagnostics in the current editor.
TextDocument * const docToChange = document("mainwindow.cpp");
docToChange->setSilentReload();
QFile otherSource(filePath("mainwindow.cpp").toString());
QVERIFY(otherSource.open(QIODevice::WriteOnly));
otherSource.write("blubb");
otherSource.close();
+ QVERIFY(waitForSignalOrTimeout(LanguageClientManager::instance(),
+ &LanguageClientManager::clientAdded, timeOutInMs()));
+ ClangdClient * const newClient = ClangModelManagerSupport::clientForProject(project());
+ QVERIFY(newClient);
+ QVERIFY(newClient != oldClient);
+ newClient->enableTesting();
if (curDoc->marks().isEmpty())
- QVERIFY(waitForSignalOrTimeout(client(), &ClangdClient::textMarkCreated, timeOutInMs()));
+ QVERIFY(waitForSignalOrTimeout(newClient, &ClangdClient::textMarkCreated, timeOutInMs()));
}