forked from qt-creator/qt-creator
CppEditor: Make check for clangd more fine-grained
... in the quickfix factories. We want to be able to offer or not offer certain quickfixes based on the current clangd version. Change-Id: I7dca69ff990ab9f1a691785cd72e633f7882ae3d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -428,9 +428,12 @@ void ClangModelManagerSupport::checkUnused(const Link &link, SearchResult *searc
|
||||
CppModelManager::Backend::Builtin)->checkUnused(link, search, callback);
|
||||
}
|
||||
|
||||
bool ClangModelManagerSupport::usesClangd(const TextEditor::TextDocument *document) const
|
||||
std::optional<QVersionNumber> ClangModelManagerSupport::usesClangd(
|
||||
const TextEditor::TextDocument *document) const
|
||||
{
|
||||
return clientForFile(document->filePath());
|
||||
if (const auto client = clientForFile(document->filePath()))
|
||||
return client->versionNumber();
|
||||
return {};
|
||||
}
|
||||
|
||||
BaseEditorDocumentProcessor *ClangModelManagerSupport::createEditorDocumentProcessor(
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
|
||||
CppEditor::BaseEditorDocumentProcessor *createEditorDocumentProcessor(
|
||||
TextEditor::TextDocument *baseTextDocument) override;
|
||||
bool usesClangd(const TextEditor::TextDocument *document) const override;
|
||||
std::optional<QVersionNumber> usesClangd(const TextEditor::TextDocument *document) const override;
|
||||
|
||||
static QList<LanguageClient::Client *> clientsForOpenProjects();
|
||||
static ClangdClient *clientForProject(const ProjectExplorer::Project *project);
|
||||
|
||||
Reference in New Issue
Block a user