forked from qt-creator/qt-creator
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:
@@ -1264,8 +1264,6 @@ public:
|
||||
ClangdQuickFixProcessor(LanguageClient::Client *client)
|
||||
: LanguageClientQuickFixAssistProcessor(client)
|
||||
{
|
||||
// Fixes are already provided inline with the diagnostics.
|
||||
setOnlyKinds({CodeActionKinds::Refactor});
|
||||
}
|
||||
|
||||
private:
|
||||
|
@@ -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();
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user