forked from qt-creator/qt-creator
clangd: update current document filter after initialize
This makes sure that the lsp filter gets enabled if a document is opened before the corresponding clangd server was initialized. This happens when loading a session with an open document. Change-Id: I7987ea60c6fca8b5c070af3a7bcd5325667ed0c5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "clangcompletioncontextanalyzer.h"
|
||||
#include "clangconstants.h"
|
||||
#include "clangdlocatorfilters.h"
|
||||
#include "clangdqpropertyhighlighter.h"
|
||||
#include "clangmodelmanagersupport.h"
|
||||
#include "clangpreprocessorassistproposalitem.h"
|
||||
@@ -1558,6 +1559,9 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir)
|
||||
});
|
||||
|
||||
connect(this, &Client::initialized, this, [this] {
|
||||
auto currentDocumentFilter = static_cast<ClangdCurrentDocumentFilter *>(
|
||||
CppEditor::CppModelManager::instance()->currentDocumentFilter());
|
||||
currentDocumentFilter->updateCurrentClient();
|
||||
// If we get this signal while there are pending searches, it means that
|
||||
// the client was re-initialized, i.e. clangd crashed.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user