diff options
author | Eike Ziller <eike.ziller@qt.io> | 2024-03-22 15:13:34 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2024-03-22 15:13:34 +0100 |
commit | 8500dd03bfb574d13ae1b02ff62d093eac221214 (patch) | |
tree | 61d6151ace1ef4adddf7e97c4d82b0580d4ee39f /src/plugins/clangcodemodel | |
parent | e57e0b0bfacea51275332feae60614a53a95591b (diff) | |
parent | aa7f711c54674de3abaf326b687d90f58bd6736a (diff) |
Merge remote-tracking branch 'origin/13.0'
Conflicts:
doc/qtcreator/src/overview/creator-only/creator-keyboard-shortcuts.qdoc
Change-Id: I2db85da9f4a0593217951313020d71d430986961
Diffstat (limited to 'src/plugins/clangcodemodel')
-rw-r--r-- | src/plugins/clangcodemodel/clangdfindreferences.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/clangcodemodel/clangdfindreferences.cpp b/src/plugins/clangcodemodel/clangdfindreferences.cpp index b7e62d6e055..13968801e7b 100644 --- a/src/plugins/clangcodemodel/clangdfindreferences.cpp +++ b/src/plugins/clangcodemodel/clangdfindreferences.cpp @@ -291,12 +291,17 @@ void ClangdFindReferences::Private::handleFindUsagesResult(const QList<Location> for (const Location &loc : locations) fileData[loc.uri()].rangesAndLineText.push_back({loc.range(), {}}); + QSet<FilePath> canonicalFilePaths; for (auto it = fileData.begin(); it != fileData.end();) { const Utils::FilePath filePath = client()->serverUriToHostPath(it.key()); if (!filePath.exists()) { // https://github.com/clangd/clangd/issues/935 it = fileData.erase(it); continue; } + if (!Utils::insert(canonicalFilePaths, filePath.canonicalPath())) { // QTCREATORBUG-30546 + it = fileData.erase(it); + continue; + } const QStringList lines = SymbolSupport::getFileContents(filePath); it->fileContent = lines.join('\n'); for (auto &rangeWithText : it.value().rangesAndLineText) { |