[PATCH] D82436: [clangd] Implement textDocument/foldingRange

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 00:29:57 PDT 2020


kbobyrev created this revision.
kbobyrev added a reviewer: sammccall.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

This patch introduces basic textDocument/foldingRange support. It relies on
textDocument/documentSymbols to collect all symbols and uses takes ranges
to create folds.

The next steps for textDocument/foldingRange support would be:

- Implementing FoldingRangeClientCapabilities and respecting respect client preferences
- Specifying folding range kind
- Supporting more folding range types: PP definitions, sequential includes, public/private/protected sections of classes and structs

Tested: (Neo)Vim (coc-clangd) and VSCode.

Related issue: https://github.com/clangd/clangd/issues/310


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82436

Files:
  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/FindSymbols.cpp
  clang-tools-extra/clangd/FindSymbols.h
  clang-tools-extra/clangd/Protocol.cpp
  clang-tools-extra/clangd/Protocol.h
  clang-tools-extra/clangd/test/initialize-params.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82436.272922.patch
Type: text/x-patch
Size: 8771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200624/c2cb11a9/attachment-0001.bin>


More information about the cfe-commits mailing list