diff options
author | Marc-Andre Laperle <marc-andre.laperle@ericsson.com> | 2017-11-03 13:39:15 +0000 |
---|---|---|
committer | Marc-Andre Laperle <marc-andre.laperle@ericsson.com> | 2017-11-03 13:39:15 +0000 |
commit | 93e4eab4c616a4e933756532b1eeb2ebfc021b60 (patch) | |
tree | d2adf8e0252c86a4c2df88413c791ca31ba8d7b9 /clangd/ProtocolHandlers.cpp | |
parent | 3a0f4337cd92bc00a2ef006f710fb8a1cf1a8cf2 (diff) |
[clangd] Handle clangd.applyFix server-side
Summary:
When the user selects a fix-it (or any code action with commands), it is
possible to let the client forward the selected command to the server.
When the clangd.applyFix command is handled on the server, it can send a
workspace/applyEdit request to the client. This has the advantage that
the client doesn't explicitly have to know how to handle
clangd.applyFix. Therefore, the code to handle clangd.applyFix in the VS
Code extension (and any other Clangd client) is not required anymore.
Reviewers: ilya-biryukov, sammccall, Nebiroth, hokein
Reviewed By: hokein
Subscribers: ioeric, hokein, rwols, puremourning, bkramer, ilya-biryukov
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D39276
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@317322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clangd/ProtocolHandlers.cpp')
-rw-r--r-- | clangd/ProtocolHandlers.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clangd/ProtocolHandlers.cpp b/clangd/ProtocolHandlers.cpp index 507fc421..4ca6ee0b 100644 --- a/clangd/ProtocolHandlers.cpp +++ b/clangd/ProtocolHandlers.cpp @@ -72,4 +72,5 @@ void clangd::registerCallbackHandlers(JSONRPCDispatcher &Dispatcher, Register("textDocument/switchSourceHeader", &ProtocolCallbacks::onSwitchSourceHeader); Register("workspace/didChangeWatchedFiles", &ProtocolCallbacks::onFileEvent); + Register("workspace/executeCommand", &ProtocolCallbacks::onCommand); } |