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

Method signature_of

codegraph-kernel/src/lua.rs:390–408  ·  view source on GitHub ↗

getSignature — lua (lua.ts:83-86) / luau (luau.ts:26-35).

(&self, node: Node<'t>)

Source from the content-addressed store, hash-verified

388
389 /// getSignature — lua (lua.ts:83-86) / luau (luau.ts:26-35).
390 fn signature_of(&self, node: Node<'t>) -> Option<String> {
391 let params = node.child_by_field_name("parameters")?;
392 let mut sig = self.text(params).to_string();
393 if self.is_luau {
394 // Return type = the named child AFTER `parameters` (found by
395 // startIndex match), unless it's the block.
396 let mut cursor = node.walk();
397 let kids: Vec<Node<'t>> = node.named_children(&mut cursor).collect();
398 if let Some(idx) = kids.iter().position(|k| k.start_byte() == params.start_byte()) {
399 if let Some(ret) = kids.get(idx + 1) {
400 if ret.kind() != "block" {
401 sig.push_str(": ");
402 sig.push_str(self.text(*ret));
403 }
404 }
405 }
406 }
407 Some(sig)
408 }
409
410 /// isExported (luau.ts:23) — the raw 7-unit slice is an ASCII prefix test.
411 fn is_exported_of(&self, node: Node<'t>) -> Option<bool> {

Callers 3

extract_functionMethod · 0.45
extract_methodMethod · 0.45

Calls 5

walkMethod · 0.80
positionMethod · 0.80
textMethod · 0.65
getMethod · 0.65
collectMethod · 0.45

Tested by

no test coverage detected