Skip to content

Commit f2f91d3

Browse files
committed
feat(parser): qualify ClassName.method call targets via symbol table
When receiver filtering emits "Foo.bar" (uppercase receiver), resolve it to "/path/file::Foo.bar" by looking up the class entry in the file symbol table. Closes a resolution gap where class-qualified bare calls stayed unresolved after the receiver filter rewrite.
1 parent 3b31b58 commit f2f91d3

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

code_review_graph/parser.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,11 +1715,22 @@ def _resolve_call_targets(
17151715
resolved: list[EdgeInfo] = []
17161716
for edge in edges:
17171717
if edge.kind in ("CALLS", "REFERENCES") and "::" not in edge.target:
1718-
if edge.target in symbols:
1718+
target = edge.target
1719+
if target in symbols:
1720+
target = symbols[target]
1721+
elif "." in target:
1722+
# ClassName.method -- qualify via the class name so the
1723+
# edge points at /path/file::ClassName.method.
1724+
cls_name = target.split(".", 1)[0]
1725+
if cls_name in symbols:
1726+
target = (
1727+
f"{symbols[cls_name].rsplit('::', 1)[0]}::{target}"
1728+
)
1729+
if target != edge.target:
17191730
edge = EdgeInfo(
17201731
kind=edge.kind,
17211732
source=edge.source,
1722-
target=symbols[edge.target],
1733+
target=target,
17231734
file_path=edge.file_path,
17241735
line=edge.line,
17251736
extra=edge.extra,

0 commit comments

Comments
 (0)