[clangd] Implement textDocument/foldingRange
Summary: 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 * Migrating from DocumentSymbol implementation to custom RecursiveASTVisitor flow that will allow more flexibility * Supporting more folding range types: comments, PP conditional regions, includes and other code regions (e.g. public/private/protected sections of classes, control flow statement bodies) Tested: (Neo)Vim (coc-clangd) and VSCode. Related issue: https://github.com/clangd/clangd/issues/310 Reviewers: sammccall Reviewed By: sammccall Subscribers: nridge, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D82436
Loading
Please sign in to comment