ClangCodeModel: Remove ClangModelManagerSupport::instance()

Not needed.

Change-Id: I46ee3a493ddb59c4b5f0e3eb4443d7f348a6b074
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2022-08-02 16:15:38 +02:00
parent 3a53eebcfd
commit c9b1e3a744
3 changed files with 3 additions and 15 deletions

View File

@@ -32,6 +32,7 @@
#include "tasktimers.h"
#include <cppeditor/semantichighlighter.h>
#include <languageclient/languageclientmanager.h>
#include <languageclient/semantichighlightsupport.h>
#include <languageserverprotocol/lsptypes.h>
#include <texteditor/blockrange.h>
@@ -381,7 +382,7 @@ void doSemanticHighlighting(
const Position startPos(r.line - 1, r.column - 1);
virtualRanges << Range(startPos, startPos.withOffset(r.length, &doc));
}
QMetaObject::invokeMethod(ClangModelManagerSupport::instance(),
QMetaObject::invokeMethod(LanguageClientManager::instance(),
[filePath, virtualRanges, docRevision] {
if (ClangdClient * const client = ClangModelManagerSupport::clientForFile(filePath))
client->setVirtualRanges(filePath, virtualRanges, docRevision);

View File

@@ -79,8 +79,6 @@ using namespace LanguageClient;
namespace ClangCodeModel {
namespace Internal {
static ClangModelManagerSupport *m_instance = nullptr;
static CppEditor::CppModelManager *cppModelManager()
{
return CppEditor::CppModelManager::instance();
@@ -162,9 +160,6 @@ static void checkSystemForClangdSuitability()
ClangModelManagerSupport::ClangModelManagerSupport()
{
QTC_CHECK(!m_instance);
m_instance = this;
watchForExternalChanges();
watchForInternalChanges();
setupClangdConfigFile();
@@ -214,7 +209,6 @@ ClangModelManagerSupport::ClangModelManagerSupport()
ClangModelManagerSupport::~ClangModelManagerSupport()
{
m_generatorSynchronizer.waitForFinished();
m_instance = nullptr;
}
void ClangModelManagerSupport::followSymbol(const CppEditor::CursorInEditor &data,
@@ -806,10 +800,5 @@ void ClangModelManagerSupport::reinitializeBackendDocuments(const QStringList &p
}
}
ClangModelManagerSupport *ClangModelManagerSupport::instance()
{
return m_instance;
}
} // Internal
} // ClangCodeModel

View File

@@ -69,8 +69,6 @@ public:
static ClangdClient *clientForProject(const ProjectExplorer::Project *project);
static ClangdClient *clientForFile(const Utils::FilePath &file);
static ClangModelManagerSupport *instance();
private:
void followSymbol(const CppEditor::CursorInEditor &data,
const Utils::LinkHandler &processLinkCallback, bool resolveTarget,