This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Move dependencies of ClangdLSPServer out of its implementation
AbandonedPublic

Authored by krasimir on Jun 14 2017, 4:25 AM.

Details

Reviewers
ilya-biryukov
Summary

This patch moves the GlobalCompilationDatabase and FileSystemProvider
dependencies of ClangdLSPServer to ClangdMain and makes ClangdLSPServer itself a DiagnosticsConsumer.

Event Timeline

krasimir created this revision.Jun 14 2017, 4:25 AM
krasimir edited the summary of this revision. (Show Details)Jun 14 2017, 4:28 AM
krasimir added a reviewer: ilya-biryukov.
krasimir added a project: Restricted Project.
krasimir added a subscriber: cfe-commits.
ilya-biryukov added inline comments.Jun 14 2017, 5:56 AM
clangd/ClangdLSPServer.h
26

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.

29

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.

krasimir abandoned this revision.Jun 14 2017, 6:35 AM

On a second thought, meh :D