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

Method emit_require

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

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