Delphi concept

This commit is contained in:
Olaf Monien
2026-02-10 23:55:42 +01:00
parent adaff67219
commit 645fd71e45
12 changed files with 529 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# Unit Resolution Heuristics (uses → File)
## Input
- Extracted edges of kind `imports` from `uses` clauses.
- Extracted nodes of kind `unit|program|package|library` with their names.
## MVP Algorithm
1. Build `unitName -> nodeId` map for all indexed files.
2. For each `imports` edge with target name `X`:
- try exact match `X`
- try case-insensitive match
- try namespace normalization:
- `System.SysUtils` may correspond to unit `SysUtils` (optional heuristic)
3. If resolved: store `edge.to_node_id = targetNodeId`.
4. If not resolved: keep `edge.to_symbol = X` so 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.