From ab7560bec47bd20e0bdc05018e09a6ac3070a1b5 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 15 Feb 2021 10:38:48 +0100 Subject: [PATCH] LanguageClient: remove dead code All files that match the language filter are opened in the server currently, no matter whether they belong to the project or not. We want to track changes to files outside the project, because the project might depend on those files. Change-Id: If78142489ad22899f8bd899ae3a7ce3f58618fa3 Reviewed-by: Christian Stenger --- src/plugins/languageclient/client.cpp | 15 --------------- src/plugins/languageclient/client.h | 1 - 2 files changed, 16 deletions(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 221264c6a39..66c7bfdd814 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -767,12 +767,7 @@ const ProjectExplorer::Project *Client::project() const void Client::setCurrentProject(ProjectExplorer::Project *project) { - using namespace ProjectExplorer; - if (m_project) - disconnect(m_project, &Project::fileListChanged, this, &Client::projectFileListChanged); m_project = project; - if (m_project) - connect(m_project, &Project::fileListChanged, this, &Client::projectFileListChanged); } void Client::projectOpened(ProjectExplorer::Project *project) @@ -809,16 +804,6 @@ void Client::projectClosed(ProjectExplorer::Project *project) sendContent(change); } -void Client::projectFileListChanged() -{ - for (Core::IDocument *doc : Core::DocumentModel::openedDocuments()) { - if (m_project->isKnownFile(doc->filePath())) { - if (auto textDocument = qobject_cast(doc)) - openDocument(textDocument); - } - } -} - void Client::setSupportedLanguage(const LanguageFilter &filter) { m_languagFilter = filter; diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index 8cafaaae900..72894536790 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -128,7 +128,6 @@ public: const ProjectExplorer::Project *project() const; void projectOpened(ProjectExplorer::Project *project); void projectClosed(ProjectExplorer::Project *project); - void projectFileListChanged(); void sendContent(const LanguageServerProtocol::IContent &content); void cancelRequest(const LanguageServerProtocol::MessageId &id);