Skip to main content

Module references

Module references 

Source

Functions§

all_references
byte_to_decl_via_external_refs
Check if cursor byte position falls on a Yul external reference in the given file. Returns the Solidity declaration id if so.
byte_to_id
dedup_locations
Deduplicate locations: remove exact duplicates and contained-range duplicates. When two locations share the same URI and one range contains the other (e.g., IPoolManager.ModifyLiquidityParams col 9-43 and ModifyLiquidityParams col 22-43), keep only the narrower range. This prevents qualified type paths from producing two result entries per usage site.
goto_references_cached
Find all references using pre-built CachedBuild indices. Avoids redundant O(N) AST traversal by reusing cached node maps.
goto_references_for_target
Find all references to a definition in a single AST build, identified by the definition’s file path + byte offset (stable across builds). Uses byte_to_id to find this build’s node ID for the same definition, then scans for referenced_declaration matches.
id_to_location
id_to_location_with_index
resolve_target_location
Resolve cursor position to the target definition’s location (abs_path + byte offset). Node IDs are not stable across builds, but byte offsets within a file are. Returns (abs_path, byte_offset) of the definition node, usable with byte_to_id in any other build that includes that file.