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

Method emit_require

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

The hook's `emit` (lua.ts:108-126): import node at the CALL node + imports ref from the stack top.

(&mut self, call: Node<'t>, module: &str)

Source from the content-addressed store, hash-verified

337 /// The hook's `emit` (lua.ts:108-126): import node at the CALL node +
338 /// imports ref from the stack top.
339 fn emit_require(&mut self, call: Node<'t>, module: &str) {
340 let (sig, _) = util::slice_utf16(self.text(call).trim(), 100);
341 let imp = self.create_node(
342 "import",
343 module,
344 call,
345 Extra { signature: Some(sig), ..Default::default() },
346 );
347 if imp.is_some() && !self.stack.is_empty() {
348 let parent_row = self.top_row();
349 self.push_ref_at(parent_row, module, "imports", call);
350 }
351 }
352
353 /// getReceiverType (lua.ts:92-99).
354 fn receiver_type(&self, node: Node<'t>) -> Option<&'t str> {

Callers 1

visitMethod · 0.80

Calls 5

slice_utf16Function · 0.85
textMethod · 0.45
create_nodeMethod · 0.45
top_rowMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected