forked from qt-creator/qt-creator
ClangCodeModel: remove duplicates from clangd quickfix assist
Do not report quickfixes with a diagnostic since those are already collected by the ClangdQuickFixFactory as builtin quickfixes. Change-Id: I8d29a08b823291f8beaa762c09b7d29a4b9d0384 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -35,7 +35,10 @@
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
namespace TextEditor { class IAssistProposal; }
|
||||
namespace TextEditor {
|
||||
class IAssistProposal;
|
||||
class GenericProposal;
|
||||
} // namespace TextEditor
|
||||
|
||||
namespace LanguageClient {
|
||||
|
||||
@@ -52,6 +55,17 @@ private:
|
||||
QPointer<Client> m_client;
|
||||
};
|
||||
|
||||
class LANGUAGECLIENT_EXPORT CommandQuickFixOperation : public TextEditor::QuickFixOperation
|
||||
{
|
||||
public:
|
||||
CommandQuickFixOperation(const LanguageServerProtocol::Command &command, Client *client);
|
||||
void perform() override;
|
||||
|
||||
private:
|
||||
LanguageServerProtocol::Command m_command;
|
||||
QPointer<Client> m_client;
|
||||
};
|
||||
|
||||
class LANGUAGECLIENT_EXPORT LanguageClientQuickFixProvider : public TextEditor::IAssistProvider
|
||||
{
|
||||
public:
|
||||
@@ -77,10 +91,13 @@ public:
|
||||
|
||||
protected:
|
||||
void setOnlyKinds(const QList<LanguageServerProtocol::CodeActionKind> &only);
|
||||
Client *client() { return m_client; }
|
||||
|
||||
private:
|
||||
void handleCodeActionResponse(const LanguageServerProtocol::CodeActionRequest::Response &response);
|
||||
virtual void handleProposalReady(const TextEditor::QuickFixOperations &ops);
|
||||
void handleCodeActionResponse(
|
||||
const LanguageServerProtocol::CodeActionRequest::Response &response);
|
||||
virtual TextEditor::GenericProposal *handleCodeActionResult(
|
||||
const LanguageServerProtocol::CodeActionResult &result);
|
||||
|
||||
QSharedPointer<const TextEditor::AssistInterface> m_assistInterface;
|
||||
Client *m_client = nullptr; // not owned
|
||||
|
||||
Reference in New Issue
Block a user