graphify
graphify copied to clipboard
Swift builtins: broaden coverage (SwiftUI views, property wrappers) and scope per-language
Follow-up to #2147 / #2149 (Swift/Foundation/SwiftUI builtin filtering).
- Coverage: add SwiftUI views (
Text,Image,Button,VStack/HStack/ZStack,List,Spacer), property wrappers / Combine (State,Binding,Published,ObservedObject,StateObject,ObservableObject), concurrency (Task,MainActor), and common stdlib/CG/Foundation types (Dictionary,Result,CGFloat/CGRect/CGSize/CGPoint,Timer,Notification). - Scoping (the real fix):
_LANGUAGE_BUILTIN_GLOBALSis shared across languages, so adding Swift names suppresses a JS/Python project's ownColor/Data/Textconstructor edges. Migrate Swift to a per-language builtin set consulted only when the source file is.swift, and scope the god-node label filter by the node's source extension. This unblocks adding high-collision names likeTask/Text. - Two maintainer calls: whether
_swift_classify_baseshould skipimplementsedges to builtin protocols (closes the still-openSendablepath-bridge repro in #2147), and whether the Swift type-ref rewire should get the same builtin guard as the member-call resolver (closes the residualreferences[field]bind).
Hi — I'd like to take this if it's still free. Before coding I want to confirm scope so we don't fight #2313 or guess the two maintainer calls in (3).
My reading of the issue:
- Coverage — broaden the Swift/SwiftUI/Foundation builtin lists (views, property wrappers, concurrency, CG/stdlib types).
- Scoping — the real fix: stop consulting Swift names from a shared
_LANGUAGE_BUILTIN_GLOBALSfor every language; only apply them for.swiftsources, and scope the god-node noise filter by source extension. - Two open product calls — (a) should
_swift_classify_baseskipimplementsedges to builtin protocols (Sendable path-bridge leftover from #2147)? (b) should Swift type-ref rewire get the same builtin guard as the member-call resolver?
Proposed approach (happy to adjust):
- Land (1) first as a focused PR with fixtures/tests in the existing
test_swift_builtin_noiseshape, without yet adding high-collision names that only make sense after (2) (Text/Task/etc. stay gated until scoping exists). - For (2), treat it as a follow-up PR and align with #2313 — i.e. not a naive global per-language split that resurrects phantom
Error/set-class edges elsewhere. Prefer Swift-only consultation at the Swift resolution sites + extension-scoped god-node filter, unless you'd rather wait for the multi-definition guard in #2313 first. - Hold the two items in (3) until you call them; I won't change
implements → Sendableor type-ref rewire without an explicit yes/no.
Questions before I start:
- Is this issue still unclaimed / OK for me to work?
- OK to ship coverage (1) first, then scoping (2), as separate PRs against
v8? - For (3a) and (3b): yes / no / later?
Happy to revise the plan if you want scoping first, or a different cut.