MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / extract_identifier_reference

Method extract_identifier_reference

atomic-semantic/src/parser.rs:340–466  ·  view source on GitHub ↗

Extract a reference from an identifier

(
        &self,
        node: &Node,
        source: &str,
        file_path: &str,
        seen: &mut HashSet<(String, u32)>,
    )

Source from the content-addressed store, hash-verified

338
339 /// Extract a reference from an identifier
340 fn extract_identifier_reference(
341 &self,
342 node: &Node,
343 source: &str,
344 file_path: &str,
345 seen: &mut HashSet<(String, u32)>,
346 ) -> Option<Reference> {
347 let symbol = node.utf8_text(source.as_bytes()).ok()?.to_string();
348 let line = node.start_position().row as u32 + 1;
349
350 // Skip keywords and common built-ins
351 if matches!(
352 symbol.as_str(),
353 "true"
354 | "false"
355 | "null"
356 | "undefined"
357 | "this"
358 | "super"
359 | "console"
360 | "window"
361 | "document"
362 | "global"
363 | "process"
364 | "module"
365 | "exports"
366 | "require"
367 | "import"
368 | "export"
369 | "default"
370 | "async"
371 | "await"
372 | "new"
373 | "delete"
374 | "typeof"
375 | "instanceof"
376 | "void"
377 | "yield"
378 | "return"
379 | "throw"
380 | "try"
381 | "catch"
382 | "finally"
383 | "if"
384 | "else"
385 | "switch"
386 | "case"
387 | "break"
388 | "continue"
389 | "for"
390 | "while"
391 | "do"
392 | "in"
393 | "of"
394 | "with"
395 | "debugger"
396 | "class"
397 | "extends"

Callers 1

Calls 6

as_bytesMethod · 0.45
lenMethod · 0.45
cloneMethod · 0.45
containsMethod · 0.45
insertMethod · 0.45
linesMethod · 0.45

Tested by

no test coverage detected