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

Method signature_of

codegraph-kernel/src/lua.rs:392–410  ·  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

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