Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Remove Tree-sitter AST logging from `SelectLargerSyntaxNode` (#29949)

Michael Sloan0b10eb75771b
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 7cb0ed18758..02cc8a3306f 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -12999,10 +12999,9 @@ impl Editor {
}
let mut new_range = old_range.clone();
- let mut new_node = None;
- while let Some((node, containing_range)) = buffer.syntax_ancestor(new_range.clone())
+ while let Some((_node, containing_range)) =
+ buffer.syntax_ancestor(new_range.clone())
{
- new_node = Some(node);
new_range = match containing_range {
MultiOrSingleBufferOffsetRange::Single(_) => break,
MultiOrSingleBufferOffsetRange::Multi(range) => range,
@@ -13014,17 +13013,6 @@ impl Editor {
}
}
- if let Some(node) = new_node {
- // Log the ancestor, to support using this action as a way to explore TreeSitter
- // nodes. Parent and grandparent are also logged because this operation will not
- // visit nodes that have the same range as their parent.
- log::info!("Node: {node:?}");
- let parent = node.parent();
- log::info!("Parent: {parent:?}");
- let grandparent = parent.and_then(|x| x.parent());
- log::info!("Grandparent: {grandparent:?}");
- }
-
selected_larger_node |= new_range != old_range;
Selection {
id: selection.id,