[PATCH] D129648: Use pseudo parser for folding ranges

Utkarsh Saxena via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 15 07:14:02 PDT 2022


usaxena95 added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:185
+    if (auto *Paired = Tok.pair()) {
+      if (Tok.Line < Paired->Line) {
+        Position Start = offsetToPosition(
----------------
hokein wrote:
> The `if` logic seems tricky, it is doing two different things:
> 
> 1) avoid creating duplicate `FoldingRange` for a pair bracket
> 2) avoid creating a FoldingRange if the pair bracket is on the same line.
> 
> Are both intended?
Yes. Both of these are intentional. Added a comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129648/new/

https://reviews.llvm.org/D129648



More information about the cfe-commits mailing list