[PATCH] D34201: [clangd] Move dependencies of ClangdLSPServer out of its implementation

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 14 05:56:53 PDT 2017


ilya-biryukov added inline comments.


================
Comment at: clangd/ClangdLSPServer.h:26
 /// dispatch and ClangdServer together.
-class ClangdLSPServer {
+class ClangdLSPServer : public DiagnosticsConsumer {
 public:
----------------
I would not expect ClangdLSPServer to be passed as a DiagnosticsConsumer.
It's not the purpose of this class at all, therefore I don't think it's a good idea to inherit publicly from DiagnosticsConsumer.
Private inheritance would be fine (to reduce code repetition), but is generally considered to be hard-to-grasp.


================
Comment at: clangd/ClangdLSPServer.h:29
+  ClangdLSPServer(JSONOutput &Out,
+                  GlobalCompilationDatabase &CDB,
+                  FileSystemProvider &FSProvider,
----------------
What are the use-cases for getting GlobalCompilationDatabase and FileSystemProvider as an outside parameter?
It actually seems to me they are implementation details of ClangdLSPServer.

I.e. the purpose of this class is to provide an easy interface to just run LSP server without worrying about its configuration.



https://reviews.llvm.org/D34201





More information about the cfe-commits mailing list