ClangCodeModel: Retrieve all kinds of clangd tweaks

Contrary to our expectation, the "quickfix" tweaks are not part of the
inline code actions after all.
User-observable effect: "Populate switch" becomes available.
Amends 8b63dfccc6.

Change-Id: I4f7fa25a58bb54dbdb470d7db064b4d804c34d26
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2022-02-04 11:04:52 +01:00
parent 3a6dff6743
commit 0e7de92319
3 changed files with 0 additions and 11 deletions

View File

@@ -1264,8 +1264,6 @@ public:
ClangdQuickFixProcessor(LanguageClient::Client *client)
: LanguageClientQuickFixAssistProcessor(client)
{
// Fixes are already provided inline with the diagnostics.
setOnlyKinds({CodeActionKinds::Refactor});
}
private:

View File

@@ -92,8 +92,6 @@ IAssistProposal *LanguageClientQuickFixAssistProcessor::perform(const AssistInte
auto uri = DocumentUri::fromFilePath(interface->filePath());
params.setTextDocument(TextDocumentIdentifier(uri));
CodeActionParams::CodeActionContext context;
if (!m_onlyKinds.isEmpty())
context.setOnly(m_onlyKinds);
context.setDiagnostics(m_client->diagnosticsAt(uri, cursor));
params.setContext(context);
@@ -116,11 +114,6 @@ void LanguageClientQuickFixAssistProcessor::cancel()
}
}
void LanguageClientQuickFixAssistProcessor::setOnlyKinds(const QList<CodeActionKind> &only)
{
m_onlyKinds = only;
}
void LanguageClientQuickFixAssistProcessor::handleCodeActionResponse(const CodeActionRequest::Response &response)
{
m_currentRequest.reset();

View File

@@ -85,8 +85,6 @@ private:
QSharedPointer<const TextEditor::AssistInterface> m_assistInterface;
Client *m_client = nullptr; // not owned
Utils::optional<LanguageServerProtocol::MessageId> m_currentRequest;
QList<LanguageServerProtocol::CodeActionKind> m_onlyKinds;
};
} // namespace LanguageClient