diff options
Diffstat (limited to 'src/plugins/clangcodemodel/clangdfindreferences.cpp')
-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 b7e62d6e05..13968801e7 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) { |