Back to Gitnexus

Swift Ingestion Gaps

swift-ingestion-gaps.md

1.6.34.4 KB
Original Source

Swift Ingestion Gaps

Tracks missing Swift features in the GitNexus ingestion pipeline. Organized by priority.

🔴 High Priority

Type Inference

GapDescriptionImpact
if let / guard let inside for-loop bodiesType-env binds the variable correctly but call-processor's re-parse path doesn't propagate for-loop element bindings to receiver resolutionCalls inside for item in collection are unresolved
while let bindingwhile let x = iter.next() not in DECLARATION_NODE_TYPESUncommon but valid Swift pattern

Call Resolution

GapDescriptionImpact
await expr / try expr as call wrappersawait_expression and try_expression wrap call_expression — call extraction queries match but the outer wrapper can interfere with receiver resolution in some pathsMost cases work via unwrapSwiftExpression but edge cases remain
Multi-hop chainsa.b.c() — only single-hop receiver.method() resolvedCommon in UIKit/SwiftUI code
Trailing closuresitems.map { $0.save() }$0 type not inferrableFunctional-style Swift code

🟡 Medium Priority

Symbol Extraction

GapDescriptionImpact
Enum case as callableMyEnum.case calls are member-form, not caught by constructor fallbackEnum-heavy code (Result, State enums)
Subscript declarationssubscript(i:) -> T not capturedProtocol conformance tracking
Operator overloadsstatic func + (lhs:, rhs:) not capturedMathematical types
deinitdeinit {} not capturedMinor — rarely called explicitly
Macro declarations@macro / #macro (Swift 5.9+) not capturedSwift macro ecosystem is growing

Heritage / Inheritance

GapDescriptionImpact
Multiple inheritance specifiersclass Foo: Bar, P1, P2 — only first specifier capturedMissing protocol conformance edges
Generic constraintsclass Foo<T: Equatable> — bounds not trackedAdvanced generics
Conditional conformanceextension Array: P where Element: Qwhere clause not processedCross-platform code
Protocol compositiontypealias Codable = Encodable & Decodable — not expandedType alias resolution

Export / Visibility

GapDescriptionImpact
Nested function declarationsInner func marked as exported — should be privateConservative resolution still correct (over-exports)

Module / Import

GapDescriptionImpact
@testable importTest target imports treated as opaqueTest file cross-references
Cross-package SPM importsExternal package symbols not resolvedOnly affects multi-package repos
@_exported importModule re-exports not trackedFramework wrapper patterns

🟢 Low Priority

Type Inference

GapDescriptionImpact
switch / case pattern bindingcase let x as Foo: not trackedEnum pattern matching
Tuple destructuringlet (a, b) = fn() not handledUncommon pattern
@Environment / @EnvironmentObjectSwiftUI dependency injection — no AST representationWould need heuristic resolution
@Query (SwiftData)Property wrapper types not inferrable from ASTSwiftData-specific
#if canImport(...)Conditional compilation not evaluatedCross-platform projects

✅ Resolved

GapResolutionCommit
Cross-chunk implicit importsaddSwiftImplicitImports now uses allFileList instead of chunk-only files956dfd0
private(set) false positiveRegex excludes private(set) / fileprivate(set) from unexported check0a3cdce
if let / guard let bindingextractIfGuardBinding handles optional bindings16b1a63
await / try unwrappingunwrapSwiftExpression strips wrappers before RHS analysis16b1a63
For-loop element type extractionextractForLoopBinding + extractSwiftElementTypeFromTypeNode + type_annotation population in type-env956dfd0
self / super resolutionlookupInEnv handles self/super via AST walk16b1a63
Optional chaining obj?.method()Handled via optional_chaining_expression16b1a63
Multi-inheritance specifiersFirst specifier captured via inheritance_specifier query16b1a63