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.
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.
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.