[semantic-reference-resolution] Patch 8: Swift: semantic qualifiedReferences via IndexStoreDB#16
Merged
Conversation
f677a7f to
c96eb7d
Compare
…rences semantically
c96eb7d to
69497b4
Compare
Review SummaryNo additional validated findings beyond the draft already recorded.
Variant: convergence-v2 Candidates: 0 | Posted: 0 | Suppressed: 0 0 comments posted · Model: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Patch 8: Swift: semantic qualifiedReferences via IndexStoreDB
Changes
Files to Modify
Established Precedents
This patch should adopt the following proven techniques rather than rolling its own. Read the references when you need detail on the API shape or invariants they impose. Each entry names a library, algorithm, pattern, paper, RFC, doc, or blog post; the trailing sentence explains how it applies to this specific patch.
Gameplan Specification
Patch Specification
Implementation Notes
import Foundationso legacy parser-era fixtures that omit Foundation imports can still be indexed; IndexStoreDB prefix mappings map those copied paths back to the adapter's emitted source paths.-index-file,-index-file-path, and a unique-index-unit-output-path. A single multi-fileswiftc -typecheckinvocation only produced occurrence records for one source in local testing, so per-file units were required for complete occurrence queries.qualifiedReferencesfrom this patch./private/var/...while enumerated fixture paths can appear as/var/...; the adapter keeps both aliases in the file lookup and query path set. Dependent patches should preserve that alias handling if they touch path normalization.swiftccan emit usable index records while still returning non-zero for intentionally invalid fixture code. The adapter allows the compiler process to return non-zero only if index records were actually produced; missing records or IndexStoreDB/library failures still raisesemanticIndexUnavailableand abort fact emission.HTTPMailBackendDecider.HTTPMailBackendDecideras well as decision method references such asHTTPMailBackendDecider.decidePath. Rule 15 remains precise because it intersects against implementation decision references.Spec/Evidence Mapping:
semanticQualifiedReferences(...), which queries each reference occurrence, resolves its declaration/definition occurrence by USR, and emits<ownerFile.moduleName>.<symbol>. Evidence:sh swift/test.shassertsHTTPMailBackendDecider.decidePathappears for both direct and helper-mediated cross-file calls.SwiftFileInfo.moduleName, which uses the samecapitalizedModuleName(for:)helper as the owner file's ownmoduleNamefield. Evidence: Swift fixture assertions checkmoduleName == "HTTPMailBackendDecider"/"HTTPMailBackendClient"and the emitted qualified reference prefix matches.swift/test.shasserts localdecidePathForRequestdoes not surface as a qualified reference.uv run --project . python evaluate_test.py,cd go && go test .,sh typescript/test.sh, andsh swift/test.shpassed.sh ocaml/test.shremained environment-blocked by the missing local OCaml switch andyojson.