fix: cross-language refs, TSX JSX-prop indexing, Swift field refs, TS export signatures#55
Merged
Merged
Conversation
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
… export signatures Five defects surfaced by an external smoke test on real Swift / TSX / Go projects. None caught by the bench corpus because it has no Swift, no TSX with JSX-prop async fns, and no polyglot same-name symbols. - Investigate cross-pollution: `cymbal investigate` resolves to a single symbol but FindReferences/FindImpact were name-only, so e.g. a Go struct named App leaked refs from a TSX function with the same name. Added FindReferencesScoped / FindImpactScoped that filter by language; wired Investigate / InvestigateResolved to pass the resolved symbol's language. `cymbal refs` keeps documented best-effort name-only behavior. - TSX JSX-prop arrow fns indexed as `method async`: .tsx files were parsed with the plain typescript grammar, which can't see JSX boundaries. Split tsx into its own language entry using tree-sitter-typescript's TSX grammar; route `tsx` through the JS classifier / refs / implements dispatch. - Swift field/property refs returned 0: extractRefSwift only handled call_expression and user_type, missing navigation_expression. Added navigation handling that captures the receiver when parent is a call, and the trailing member otherwise — so `self.field`, `field.method()`, and `self.a.b = x` all record refs. - TS export-function signatures missing: classifyJS attaches the outer export_statement / lexical_declaration node to the symbol, so signature extraction looked for parameters on the wrapper. Added jsSignatureNode to descend through wrappers before parameter / return-type extraction. - Swift @mainactor decorator absorbed into protocol range: protocol_decl start_line included leading attributes. Added swiftKeywordAnchor to anchor swift symbol ranges to the keyword node (protocol/class/func/etc). bench check passes against the 2026-04-15 baseline; accuracy phases stay at 100% across all corpora. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d75273c to
00f7f6d
Compare
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.
Summary
Five defects surfaced by an external smoke test on real Swift / TSX / Go projects. None caught by the bench corpus because it has no Swift, no TSX with JSX-prop async fns, and no polyglot same-name symbols.
Defects fixed
cymbal investigatecross-pollutes refs across same-named symbols (GoAppstruct returned TSXApp()callsites)FindReferencesScoped/FindImpactScopedinindex/store.go;Investigate/InvestigateResolvedpasssym.Language.cymbal refskeeps documented best-effort name-only behavior.method async(asynckeyword harvested as symbol name).tsxinto its own language entry usingtree-sitter-typescript'sLanguageTSX(); routetsxthrough the JS classifier / refs / implements dispatch..ts/.mts/.ctsstill use the plain TypeScript grammar.navigation_expressionhandling inextractRefSwift— captures the receiver when parent is acall_expression, the trailing member otherwise.export functiondeclarations missingsignaturejsSignatureNodedescendsexport_statement/lexical_declarationwrappers before parameter/return-type extraction. Also fixesexport const fn = (x) => …arrow forms.@MainActor/ modifier absorbed into protocol/class rangeswiftKeywordAnchorinnodeToSymbolanchors swift declarations to the keyword node, skipping leading attributes/modifiers.The Go same-name method-receiver collision the report also flagged is documented as best-effort and is left as-is.
Verification
go test ./...— all green.go run ./bench check— PASS, no regressions vs the 2026-04-15 baseline./tmp/cymbal-defect-repro/{polyglot,swift,ts-export}confirm each defect goes from broken → fixed end-to-end.Files
index/store.go—FindReferencesScoped,FindImpactScopedindex/index.go—Investigate/InvestigateResolvedpass languageindex/index_phase3_test.go—TestInvestigateScopesRefsByLanguagelang/registry.go— splittsxlanguage usingLanguageTSX()lang/lang_test.go,walker/walker_feature_test.go— updated tsx mappingparser/parser.go— JS dispatch routestsx;jsSignatureNode,swiftKeywordAnchor,swiftNavigationRefparser/parser_feature_test.go— TSX, TS export signature, Swift field-ref, Swift attributed-protocol regressionsCHANGELOG.md— Unreleased entriesTest plan
go test ./...go run ./bench check