[PATCH] D88553: [clangd] Start using SyntaxTrees for folding ranges feature

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 24 07:43:06 PDT 2020


kbobyrev added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:60
+               *RBrace = cast_or_null<syntax::Leaf>(
+                   Stmt->findChild(syntax::NodeRole::CloseParen));
+    if (!LBrace || !RBrace)
----------------
sammccall wrote:
> strictly this should probably be findLastChild both semantically and for performance... but that doesn't exist, because it's a single-linked list for now.
> 
> Not a big deal in practice, but we should fix this (and add STL iterators!)
Added a FIXME.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88553



More information about the cfe-commits mailing list