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

Method emit_require

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

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

Callers 1

visitMethod · 0.80

Calls 5

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

Tested by

no test coverage detected