[clangd] Refactor ProtocolHandlers to decouple them from ClangdLSPServer
authorIlya Biryukov <ibiryukov@google.com>
Tue, 16 May 2017 14:40:30 +0000 (14:40 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Tue, 16 May 2017 14:40:30 +0000 (14:40 +0000)
commitafb555473ee95bbcf9d0524de4c9904b463d1d8e
treeac136dfc757ff2e78c9d7b916672849b4b1227dd
parent23453c11ff50632364fd617c9c9f2a1693621b8d
[clangd] Refactor ProtocolHandlers to decouple them from ClangdLSPServer

Summary:
A refactoring to decouple ProtocolHandlers and Language Server input parsing
loop from the ClangdLSPServer.
The input parsing was extracted from `main` to a function(runLanguageServerLoop).
ProtocolHandlers now provide an interface to handle various LSP methods,
this interface is used by ClangdLSPServer.
Methods for code formatting were moved from ProtocolHandlers to ClangdServer.
ClangdLSPServer now provides a cleaner interface that only runs Language Server
input loop.

Reviewers: bkramer, krasimir

Reviewed By: krasimir

Subscribers: cfe-commits, klimek

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D33201

llvm-svn: 303173
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/ClangdLSPServer.h
clang-tools-extra/clangd/ClangdMain.cpp
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/ClangdServer.h
clang-tools-extra/clangd/JSONRPCDispatcher.cpp
clang-tools-extra/clangd/JSONRPCDispatcher.h
clang-tools-extra/clangd/ProtocolHandlers.cpp
clang-tools-extra/clangd/ProtocolHandlers.h