diff options
| author | Christian Kandeler <christian.kandeler@qt.io> | 2021-04-20 15:46:35 +0200 |
|---|---|---|
| committer | Christian Kandeler <christian.kandeler@qt.io> | 2021-04-27 07:37:25 +0000 |
| commit | 91b6c58518ad0c2379c0511e8a4a25f3fd79443f (patch) | |
| tree | 7ff30031ee82362f16fd3e6722a6f50777b1321a /src/plugins/clangcodemodel/clangrefactoringengine.cpp | |
| parent | 8e352af0ecd3c330a96f7ca67067f0dfe200a0e4 (diff) | |
| download | qt-creator-91b6c58518ad0c2379c0511e8a4a25f3fd79443f.tar.gz | |
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>
Diffstat (limited to 'src/plugins/clangcodemodel/clangrefactoringengine.cpp')
| -rw-r--r-- | src/plugins/clangcodemodel/clangrefactoringengine.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/plugins/clangcodemodel/clangrefactoringengine.cpp b/src/plugins/clangcodemodel/clangrefactoringengine.cpp index aad2e650eb..0328bc89ba 100644 --- a/src/plugins/clangcodemodel/clangrefactoringengine.cpp +++ b/src/plugins/clangcodemodel/clangrefactoringengine.cpp @@ -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; |
