820 B
820 B
Unit Resolution Heuristics (uses → File)
Input
- Extracted edges of kind
importsfromusesclauses. - Extracted nodes of kind
unit|program|package|librarywith their names.
MVP Algorithm
- Build
unitName -> nodeIdmap for all indexed files. - For each
importsedge with target nameX:- try exact match
X - try case-insensitive match
- try namespace normalization:
System.SysUtilsmay correspond to unitSysUtils(optional heuristic)
- try exact match
- If resolved: store
edge.to_node_id = targetNodeId. - If not resolved: keep
edge.to_symbol = Xso search still works.
DPR/DPK "in 'path'" cases (Phase 2)
In Delphi project files you can have:
uses
Foo in 'src/Foo.pas',
Bar in 'Bar.pas';
Enhancement:
- Parse optional path literal and resolve directly to file.