LanguageClient: Add signal to inform about WorkDoneProgressEnd

... and make use of it in the clangd client to be able tell when
background indexing has finished.

Change-Id: I0f3c6f9646fd66ababd08c12b2f347da5f1a3729
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-04-20 15:46:35 +02:00
parent 8e352af0ec
commit 91b6c58518
10 changed files with 35 additions and 17 deletions

View File

@@ -26,10 +26,10 @@
#include "clangrefactoringengine.h"
#include "clangeditordocumentprocessor.h"
#include "clangdclient.h"
#include "clangmodelmanagersupport.h"
#include <cpptools/cppmodelmanager.h>
#include <languageclient/client.h>
#include <languageclient/languageclientsymbolsupport.h>
#include <projectexplorer/session.h>
#include <utils/textutils.h>
@@ -91,12 +91,8 @@ void RefactoringEngine::findUsages(const CppTools::CursorInEditor &cursor,
{
ProjectExplorer::Project * const project
= ProjectExplorer::SessionManager::projectForFile(cursor.filePath());
LanguageClient::Client * const client
= ClangModelManagerSupport::instance()->clientForProject(project);
if (!client || client->state() != LanguageClient::Client::Initialized) {
// TODO: Also forward to built-in if index is not ready.
// This requires us to keep track of workDone status in the client.
// Related: Also allow to override the server string for progress info
ClangdClient * const client = ClangModelManagerSupport::instance()->clientForProject(project);
if (!client || !client->isFullyIndexed()) {
CppTools::CppModelManager::builtinRefactoringEngine()
->findUsages(cursor, std::move(callback));
return;