Add tree-sitter pattern for three-part qualified calls (#1918) - #1920
Add tree-sitter pattern for three-part qualified calls (#1918)#1920Aman-goel-04 wants to merge 1 commit into
Conversation
|
✅ Health of changed files: 2.6 → 2.9 (+0.3) 📋 At a glance Files & modules (2)
✅ Health gate: passed 📌 Before you merge
🔎 More signals (3)🗺️ Change map flowchart LR
subgraph PR ["Changed in this PR (1 with dependents)"]
f_packages_core_src_repowise_core_ingestion_parser_py[".../ingestion/parser.py 🔥"]:::changed
end
f_packages_core_src_repowise_core_analysis_dead_code_analyzer_py[".../dead_code/analyzer.py"]
f_packages_core_src_repowise_core_ingestion_parser_py --> f_packages_core_src_repowise_core_analysis_dead_code_analyzer_py
f_packages_core_src_repowise_core_analysis_dead_code_constants_py[".../dead_code/constants.py"]
f_packages_core_src_repowise_core_ingestion_parser_py --> f_packages_core_src_repowise_core_analysis_dead_code_constants_py
f_packages_core_src_repowise_core_analysis_health_complexity_languages_py[".../complexity/languages.py"]
f_packages_core_src_repowise_core_ingestion_parser_py --> f_packages_core_src_repowise_core_analysis_health_complexity_languages_py
f_packages_core_src_repowise_core_analysis_health_complexity_walker_py[".../complexity/walker.py"]
f_packages_core_src_repowise_core_ingestion_parser_py --> f_packages_core_src_repowise_core_analysis_health_complexity_walker_py
more(["+14 more dependents"])
PR --> more
w_packages_core_src_repowise_core_ingestion_models_py(["⚠️ .../ingestion/models.py changed together 16×, not in PR"]):::warn
f_packages_core_src_repowise_core_ingestion_parser_py -.- w_packages_core_src_repowise_core_ingestion_models_py
w_packages_core_src_repowise_core_analysis_dead_code_analyzer_py(["⚠️ .../dead_code/analyzer.py changed together 13×, not in PR"]):::warn
f_packages_core_src_repowise_core_ingestion_parser_py -.- w_packages_core_src_repowise_core_analysis_dead_code_analyzer_py
t_tests_integration_test_deterministic_generation_py(["✅ tests/integration/test_deterministic_generation.py"]):::guard
t_tests_integration_test_deterministic_generation_py -.-> f_packages_core_src_repowise_core_ingestion_parser_py
classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Solid arrows: code that imports the changed files (18 direct dependents, from the last indexed snapshot). Dashed: history/tests. 🔥 Hotspots touched (2)
🔗 Hidden coupling (1 file)
👀 Suggested reviewers @RaghavChamadiya 📊 See the full report for this PR |
Summary
cpp.scm's two scoped-call patterns requirename: (identifier), but tree-sitter nests a three-part qualifier left-recursively (ns::util::fn()), so the outer node'snamefield is itself aqualified_identifier. Neither pattern matched, so these calls produced no call site at all — not an unresolved one, just absent, so they never reached the resolver.@call.targetand its adjacent scope as@call.scope, matching how the existing two-part pattern already behaves.::global-qualified variants like::crc32c::Extend(...), which hit the same left-recursion shape), with zero unexpected overlap against the existing two-part pattern.Related Issues
Fixes #1918
Test Plan
Added
TestThreePartQualifiedCallProducesACallSitetotests/unit/ingestion/test_cpp_scoped_calls.py, covering:ns::util::toHex()) now resolves to the functionutil::toHex()) is unaffectedfree_thing()) is unaffectedVerified the new tree-sitter pattern directly (outside pytest) against the exact grammar shape, confirming no collision/dedup dependency with the existing two-part pattern.
Ran the new pattern against a real
google/leveldbcheckout: 19 genuine three-part call sites found and manually spot-checked against source, all correct.Full suite:
pytest tests/— 2654 passed, 5 skipped, 1 pre-existing unrelated failure (test_repo_totals_churn.py::test_a_rebased_branch_in_the_history_falls_back, a local git-rebase fixture issue, not touched by this change).Tests pass (
pytest)Lint passes (
ruff check .)Web build passes (
npm run build) (if frontend changes) — N/A, no frontend changesChecklist