[PATCH] D66592: [clangd] Send suppported codeActionKinds to the client.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 22 07:53:35 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL369656: [clangd] Send suppported codeActionKinds to the client. (authored by hokein, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D66592?vs=216625&id=216626#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66592/new/
https://reviews.llvm.org/D66592
Files:
clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
Index: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
+++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
@@ -464,6 +464,16 @@
if (!Params.capabilities.RenamePrepareSupport) // Only boolean allowed per LSP
RenameProvider = true;
+ // Per LSP, codeActionProvide can be either boolean or CodeActionOptions.
+ // CodeActionOptions is only valid if the client supports action literal
+ // via textDocument.codeAction.codeActionLiteralSupport.
+ llvm::json::Value CodeActionProvider = true;
+ if (Params.capabilities.CodeActionStructure)
+ CodeActionProvider = llvm::json::Object{
+ {"codeActionKinds",
+ {CodeAction::QUICKFIX_KIND, CodeAction::REFACTOR_KIND,
+ CodeAction::INFO_KIND}}};
+
llvm::json::Object Result{
{{"capabilities",
llvm::json::Object{
@@ -475,7 +485,7 @@
{"firstTriggerCharacter", "\n"},
{"moreTriggerCharacter", {}},
}},
- {"codeActionProvider", true},
+ {"codeActionProvider", std::move(CodeActionProvider)},
{"completionProvider",
llvm::json::Object{
{"resolveProvider", false},
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66592.216626.patch
Type: text/x-patch
Size: 1305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190822/3929aa9a/attachment.bin>
More information about the cfe-commits
mailing list