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

Method emit_method_arg

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

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

Callers 1

extract_class_membersMethod · 0.80

Calls 3

textMethod · 0.45
create_nodeMethod · 0.45
visitMethod · 0.45

Tested by

no test coverage detected