This is an archive of the discontinued LLVM Phabricator instance.

[RFC] Feature modularization for clangd
Needs ReviewPublic

Authored by sammccall on Feb 8 2021, 2:53 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

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).

Diff Detail

Event Timeline

sammccall created this revision.Feb 8 2021, 2:53 AM
sammccall requested review of this revision.Feb 8 2021, 2:53 AM
nridge added a subscriber: nridge.Feb 15 2021, 4:29 PM