LanguageClient: Use Utils::FilePath to get file content

Change-Id: Iddb2eb5c02f3e6674f1f71bb61fb1f13dec22794
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2021-05-18 07:05:39 +02:00
parent 55208afac4
commit f8ca730121
3 changed files with 14 additions and 15 deletions

View File

@@ -489,8 +489,7 @@ void ClangdClient::Private::handleFindUsagesResult(quint64 key, const QList<Loca
for (const Location &loc : locations) // TODO: Can contain duplicates. Rather fix in clang than work around it here.
refData->fileData[loc.uri()].rangesAndLineText << qMakePair(loc.range(), QString()); // TODO: Can we assume that locations for the same file are grouped?
for (auto it = refData->fileData.begin(); it != refData->fileData.end(); ++it) {
const QStringList lines = SymbolSupport::getFileContents(
it.key().toFilePath().toString());
const QStringList lines = SymbolSupport::getFileContents(it.key().toFilePath());
it->fileContent = lines.join('\n');
for (auto &rangeWithText : it.value().rangesAndLineText) {
const int lineNo = rangeWithText.first.start().line();