ClangCodeModel: Make open C++ files known to newly started clangd client

This is relevant when opening a session, for instance.

Change-Id: Iff3140296edb7b6d2b758f1f8b0b83a52fdd6f56
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-04-29 16:09:07 +02:00
parent c49a0af504
commit 78274956d0
2 changed files with 24 additions and 4 deletions

View File

@@ -97,8 +97,8 @@ void RefactoringEngine::findUsages(const CppTools::CursorInEditor &cursor,
->findUsages(cursor, std::move(callback));
return;
}
if (!client->documentOpen(cursor.textDocument()))
client->openDocument(cursor.textDocument()); // TODO: Just a workaround
QTC_ASSERT(client->documentOpen(cursor.textDocument()),
client->openDocument(cursor.textDocument()));
client->findUsages(cursor.textDocument(), cursor.cursor());
}