Skip to content

[SwiftExtract] Make the analyzer instance API public and add resolveType - #903

Open
kateinoigakukun wants to merge 1 commit into
swiftlang:mainfrom
kateinoigakukun:pr-33e23ebc92694766108b94e7616d2206b78797b7
Open

[SwiftExtract] Make the analyzer instance API public and add resolveType#903
kateinoigakukun wants to merge 1 commit into
swiftlang:mainfrom
kateinoigakukun:pr-33e23ebc92694766108b94e7616d2206b78797b7

Conversation

@kateinoigakukun

Copy link
Copy Markdown
Member

The static SwiftAnalyzer.analyze() entry point returns only the AnalysisResult, but some consumers need the analyzer itself after the run: type references can appear outside declaration signatures (e.g. in attribute arguments like @JavaExport(as: Foo.self) or BridgeJS's @JS(as: Foo.self)), and resolving those requires the module's symbol tables. Make add(filePath:text:) and analyze(beforeProcessing...:) public so a consumer can drive an analyzer instance directly, and add resolveType(_:) to resolve a TypeSyntax against the analyzed module after analysis.

The static SwiftAnalyzer.analyze() entry point returns only the
AnalysisResult, but some consumers need the analyzer itself after the
run: type references can appear outside declaration signatures (e.g.
in attribute arguments like '@JavaExport(as: Foo.self)' or BridgeJS's
'@js(as: Foo.self)'), and resolving those requires the module's symbol
tables. Make add(filePath:text:) and analyze(beforeProcessing...:)
public so a consumer can drive an analyzer instance directly, and add
resolveType(_:) to resolve a TypeSyntax against the analyzed module
after analysis.
@kateinoigakukun
kateinoigakukun requested a review from ktoso as a code owner August 21, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant