This is related to the ideas in D96244, but a bit more expansive...
Core ideas:
- the bulk of the features (though not everything) can be moved into modules, breaking up the Clangd[LSP]Server monoliths and allowing for out-of-tree features
- group together the LSP, C++ bound-to-server API, and free-function APIs for features. We no longer separate the first two in simple cases.
- allow modules to expose public C++ APIs, where we want to expose something richer than LSP
Caveats:
- this demo just pulls out formatting, which won't uncover all issues.
- Lit tests pass (so clangd works), but unit tests don't.
- Passing DraftStore into ClangdServer is a hack, need a real solution.
- I'm concerned whether richer C++ APIs will have a quite different style than the LSP-based ones. e.g. foo(Path, Position, Options) vs foo(FooParams).
clang-tidy: warning: invalid case style for member 'textDocument' [readability-identifier-naming]
not useful