MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / emit_method_arg

Method emit_method_arg

codegraph-kernel/src/rlang.rs:551–570  ·  view source on GitHub ↗

emitMethodArg (r.ts:84-98): `name = function(…)` argument entry → a `method` node positioned at the ARGUMENT node, signature from the raw parameters text, body walked hook-aware inside the method scope.

(&mut self, entry: Node<'t>)

Source from the content-addressed store, hash-verified

549 /// `method` node positioned at the ARGUMENT node, signature from the raw
550 /// parameters text, body walked hook-aware inside the method scope.
551 fn emit_method_arg(&mut self, entry: Node<'t>) {
552 stack_guard!();
553 let entry_name = match entry.child_by_field_name("name") {
554 Some(n) => n,
555 None => return,
556 };
557 let entry_value = match entry.child_by_field_name("value") {
558 Some(v) if v.kind() == "function_definition" => v,
559 _ => return,
560 };
561 let params_text = entry_value.child_by_field_name("parameters").map(|p| self.text(p));
562 let name = self.text(entry_name).to_string();
563 let method_row = self.create_node("method", &name, entry, params_text);
564 let body = entry_value.child_by_field_name("body");
565 if let (Some(row), Some(body)) = (method_row, body) {
566 self.stack.push(Scope { row, kind: "method", name });
567 self.visit(body);
568 self.stack.pop();
569 }
570 }
571
572 // --- extractCall (tree-sitter.ts:3684, 4313, 4518-4532, 4572-4580) ----
573 // R call nodes reach the generic tail: callee = RAW `function`-field text

Callers 1

extract_class_membersMethod · 0.80

Calls 5

mapMethod · 0.80
pushMethod · 0.80
textMethod · 0.65
create_nodeMethod · 0.45
visitMethod · 0.45

Tested by

no test coverage detected