MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / collect_commands

Function collect_commands

crates/opencode-tool/src/bash.rs:378–389  ·  view source on GitHub ↗
(node: tree_sitter::Node, source: &[u8], result: &mut ParsedCommand)

Source from the content-addressed store, hash-verified

376}
377
378fn collect_commands(node: tree_sitter::Node, source: &[u8], result: &mut ParsedCommand) {
379 if node.kind() == "command" {
380 process_command_node(node, source, result);
381 return;
382 }
383
384 // Recurse into children to find command nodes inside pipelines, lists, etc.
385 let mut cursor = node.walk();
386 for child in node.children(&mut cursor) {
387 collect_commands(child, source, result);
388 }
389}
390
391fn process_command_node(node: tree_sitter::Node, source: &[u8], result: &mut ParsedCommand) {
392 // Get full command text, including redirects if parent is redirected_statement

Callers 1

parse_bash_commandFunction · 0.85

Calls 2

process_command_nodeFunction · 0.85
childrenMethod · 0.80

Tested by

no test coverage detected