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

Method emit_method_arg

codegraph-kernel/src/rlang.rs:550–569  ·  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

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

Callers 1

extract_class_membersMethod · 0.80

Calls 3

textMethod · 0.65
create_nodeMethod · 0.45
visitMethod · 0.45

Tested by

no test coverage detected