This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5ad6bbacf091: [clangd] Start using SyntaxTrees for folding
ranges feature (authored by kbobyrev).
Repository:
rG LLVM Github Monorepo
CHANGES SIN
kbobyrev updated this revision to Diff 301009.
kbobyrev added a comment.
Resolve merge conflict.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88553/new/
https://reviews.llvm.org/D88553
Files:
clang-tools-extra/clangd/SemanticSelection.cpp
cla
kbobyrev updated this revision to Diff 301008.
kbobyrev added a comment.
Address post-LGTM comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88553/new/
https://reviews.llvm.org/D88553
Files:
clang-tools-extra/clangd/SemanticSelection.cpp
sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:42
+
+llvm::Optional toFoldingRange(LocInfo Begin, LocInfo End,
+
kbobyrev added inline comments.
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:60
+ *RBrace = cast_or_null(
+ Stmt->findChild(syntax::NodeRole::CloseParen));
+if (!LBrace || !RBrace)
sammccall wrote:
> strictly this
kbobyrev updated this revision to Diff 300479.
kbobyrev marked 3 inline comments as done.
kbobyrev added a comment.
Decompose locations and add checks for FileID == MainFileID.
Also, rebase on top of master.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm
sammccall added inline comments.
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:40
-// Recursively collects FoldingRange from a symbol and its children.
-void collectFoldingRanges(DocumentSymbol Symbol,
- std::vector &Result) {
+llvm::Option
gribozavr2 added inline comments.
Comment at: clang/include/clang/Tooling/Syntax/Tree.h:172-174
/// Find the first node with a corresponding role.
Node *findChild(NodeRole R);
+ const Node *findChild(NodeRole R) const;
eduucaldas wrote:
> I think that make
kbobyrev updated this revision to Diff 299620.
kbobyrev added a comment.
Fix a typo and remove invalid const-ness.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88553/new/
https://reviews.llvm.org/D88553
Files:
clang-tools-extra/clangd/SemanticS
kbobyrev updated this revision to Diff 299619.
kbobyrev marked an inline comment as done.
kbobyrev added a comment.
Prevent code duplication for const-nonconst versions of the same function.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88553/new/
eduucaldas added inline comments.
Comment at: clang/include/clang/Tooling/Syntax/Tree.h:172-174
/// Find the first node with a corresponding role.
Node *findChild(NodeRole R);
+ const Node *findChild(NodeRole R) const;
I think that makes sense, since all t
eduucaldas added inline comments.
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:52-55
+const syntax::Token *FirstToken = Tree->findFirstLeaf()->getToken(),
+*LastToken = Tree->findLastLeaf()->getToken();
+assert(FirstToken->kind() == t
kbobyrev updated this revision to Diff 299449.
kbobyrev added a comment.
Resolve comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88553/new/
https://reviews.llvm.org/D88553
Files:
clang-tools-extra/clangd/SemanticSelection.cpp
clang-too
sammccall added inline comments.
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:52-55
+const syntax::Token *FirstToken = Tree->findFirstLeaf()->getToken(),
+*LastToken = Tree->findLastLeaf()->getToken();
+assert(FirstToken->kind() == to
kbobyrev added inline comments.
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:52-55
+const syntax::Token *FirstToken = Tree->findFirstLeaf()->getToken(),
+*LastToken = Tree->findLastLeaf()->getToken();
+assert(FirstToken->kind() == tok
kbobyrev updated this revision to Diff 299438.
kbobyrev marked 9 inline comments as done.
kbobyrev added a comment.
Resolve review comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88553/new/
https://reviews.llvm.org/D88553
Files:
clang-to
sammccall added inline comments.
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:39
FoldingRange Range;
- Range.startLine = Symbol.range.start.line;
- Range.startCharacter = Symbol.range.start.character;
- Range.endLine = Symbol.range.end.line;
- Range.endCharac
gribozavr2 added inline comments.
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:37
-// Recursively collects FoldingRange from a symbol and its children.
-void collectFoldingRanges(DocumentSymbol Symbol,
- std::vector &Result) {
+FoldingRang
eduucaldas added inline comments.
Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:49-51
+ if (Node->getKind() == syntax::NodeKind::CompoundStatement) {
+const auto *Tree = dyn_cast(Node);
+assert(Tree);
Comment at: clang-to
kbobyrev added a comment.
@sammccall I've reduced the patch to the bare minimum (compound statements) as
I've had some issues with couple of other kinds of folding ranges and I'll be
adding support for the node kinds one by one.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
20 matches
Mail list logo