[PATCH] D38464: [clangd] less boilerplate in RPC dispatch

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 09:39:40 PDT 2017


sammccall created this revision.

Make the ProtocolHandlers glue between JSONRPCDispatcher and
ClangdLSPServer generic.
Eliminate small differences between methods, de-emphasize the unimportant
distinction between notifications and methods.

ClangdLSPServer is no longer responsible for producing a complete
JSON-RPC response, just the JSON of the result object. (In future, we
should move that JSON serialization out, too).
Handler methods now take a context object that we may hang more
functionality off in the future.

Added documentation to ProtocolHandlers.


https://reviews.llvm.org/D38464

Files:
  clangd/ClangdLSPServer.cpp
  clangd/ClangdLSPServer.h
  clangd/JSONRPCDispatcher.cpp
  clangd/JSONRPCDispatcher.h
  clangd/Protocol.cpp
  clangd/Protocol.h
  clangd/ProtocolHandlers.cpp
  clangd/ProtocolHandlers.h
  test/clangd/fixits.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38464.117373.patch
Type: text/x-patch
Size: 38367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171002/050ec7f1/attachment-0001.bin>


More information about the cfe-commits mailing list