[PATCH] D96507: [clangd] Move command handlers into a map in ClangdLSPServer. NFC
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 11 10:26:26 PST 2021
kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.
thanks, lgtm!
================
Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:587
+ std::vector<llvm::StringRef> Commands;
+ llvm::copy(CommandHandlers.keys(), std::back_inserter(Commands));
+ llvm::sort(Commands);
----------------
nit: `llvm::append_range(Commands, CommandHandlers.keys())`
================
Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:649
{"executeCommandProvider",
- llvm::json::Object{
- {"commands",
- {ExecuteCommandParams::CLANGD_APPLY_FIX_COMMAND,
- ExecuteCommandParams::CLANGD_APPLY_TWEAK}},
- }},
+ llvm::json::Object{{"commands", Commands}}},
{"typeHierarchyProvider", true},
----------------
nit: `std::move(Commands)`
================
Comment at: clang-tools-extra/clangd/Protocol.h:918
// Command to apply fix-its. Uses WorkspaceEdit as argument.
const static llvm::StringLiteral CLANGD_APPLY_FIX_COMMAND;
// Command to apply the code action. Uses TweakArgs as argument.
----------------
can we also move these into ClangdLSPServer now ?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96507/new/
https://reviews.llvm.org/D96507
More information about the cfe-commits
mailing list