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

Method capture_value_ref_scope

codegraph-kernel/src/tsjs/mod.rs:418–440  ·  view source on GitHub ↗
(&mut self, kind: &'static str, name: &str, row: u32, node: Node<'t>)

Source from the content-addressed store, hash-verified

416 // --- value references (captureValueRefScope / flushValueRefs) --------------
417
418 fn capture_value_ref_scope(&mut self, kind: &'static str, name: &str, row: u32, node: Node<'t>) {
419 if !self.variant.value_refs() {
420 return;
421 }
422 let target_kind_ok = kind == "constant" || kind == "variable";
423 if target_kind_ok
424 && util::utf16_len(name) >= 3
425 && util::has_upper_or_underscore().is_match(name)
426 {
427 let parent_ok = self
428 .stack
429 .last()
430 .map(|s| matches!(s.kind, "file" | "class" | "module" | "struct" | "enum"))
431 .unwrap_or(false);
432 if parent_ok {
433 self.fs_values.insert(name.to_string(), row);
434 *self.fs_value_counts.entry(name.to_string()).or_insert(0) += 1;
435 }
436 }
437 if matches!(kind, "function" | "method" | "constant" | "variable") {
438 self.value_scopes.push(ValueScope { row, node, name: name.to_string() });
439 }
440 }
441
442 fn flush_value_refs(&mut self, root: Node<'t>) {
443 let scopes = std::mem::take(&mut self.value_scopes);

Callers 1

create_nodeMethod · 0.45

Calls 2

utf16_lenFunction · 0.85
value_refsMethod · 0.80

Tested by

no test coverage detected