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

Method emit_method_arg

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

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