[PATCH] D96252: [RFC] Feature modularization for clangd

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 8 02:53:36 PST 2021


sammccall created this revision.
Herald added subscribers: usaxena95, kadircet, arphaman, mgorny.
sammccall requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang.

This is related to the ideas in D96244 <https://reviews.llvm.org/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).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96252

Files:
  clang-tools-extra/clangd/CMakeLists.txt
  clang-tools-extra/clangd/ClangdLSPServer.cpp
  clang-tools-extra/clangd/ClangdLSPServer.h
  clang-tools-extra/clangd/ClangdServer.cpp
  clang-tools-extra/clangd/ClangdServer.h
  clang-tools-extra/clangd/Format.cpp
  clang-tools-extra/clangd/Format.h
  clang-tools-extra/clangd/Module.h
  clang-tools-extra/clangd/ModuleDefaults.cpp
  clang-tools-extra/clangd/Protocol.cpp
  clang-tools-extra/clangd/Protocol.h
  clang-tools-extra/clangd/test/crash-non-added-files.test
  clang-tools-extra/clangd/tool/ClangdMain.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96252.322062.patch
Type: text/x-patch
Size: 39172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210208/7f19ca67/attachment-0001.bin>


More information about the cfe-commits mailing list