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

Method signature_of

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

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

Callers 2

extract_functionMethod · 0.45
extract_methodMethod · 0.45

Calls 3

getMethod · 0.65
textMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected