Add an ExportedTypes RPC to enumerate a package's public API - #8360
Draft
jkschneider wants to merge 1 commit into
Draft
Add an ExportedTypes RPC to enumerate a package's public API#8360jkschneider wants to merge 1 commit into
jkschneider wants to merge 1 commit into
Conversation
jkschneider
force-pushed
the
build-type-table-rpc
branch
from
August 1, 2026 23:18
060ab46 to
2af7b8a
Compare
jkschneider
marked this pull request as draft
August 2, 2026 12:46
jkschneider
force-pushed
the
build-type-table-rpc
branch
from
August 2, 2026 13:32
2af7b8a to
a9d84ee
Compare
Each language engine (C#, JavaScript, Go, Python) gains an `ExportedTypes` RPC method that enumerates the public types a set of "own" artifacts (assemblies / package directories / module directories) export into OpenRewrite `JavaType`. Public types the own artifacts define come back with complete bodies (members, methods, supertype, interfaces); types they only reference come back shallow (FQN only) for the caller to resolve. This lets a caller read a dependency's public API without re-parsing its sources. The enumeration is scoped to the artifact. A referenced type is named from the artifact's own metadata where possible — C# reads the `.dll`'s TypeRef FQNs, so a reference into an unloaded assembly still comes back as a shallow FQN class-ref rather than Unknown — otherwise from the dependency's own declared dependencies (Go resolves the module's `go.mod` requires; Python resolves the package's own environment). The referenced packages themselves are never enumerated, so the result is a function of the artifact alone. The response streams: the engine sends the FQNs the artifacts define first, so the caller can tell defined types from references before the first type arrives, then the types as a ref-deduplicated object stream (the same wire format `getObject` uses). `RpcReceiveQueue` gains a streaming `receiveList` overload so a client never materializes the whole list. Each response is paginated in fixed-size slices across the client's repeated identical requests, so no single message carries a large result. - rewrite-core: streaming `RpcReceiveQueue.receiveList(before, onChange, sink)`. - rewrite-csharp: `AssemblyTypeEnumerator` (Roslyn) + handler + client. - rewrite-javascript: `exportedTypes` (TypeScript checker) + handler + client. - rewrite-go: `ExportedTypes` (go/types) + handler + client. - rewrite-python: handler (ty) + client.
jkschneider
force-pushed
the
build-type-table-rpc
branch
from
August 2, 2026 13:48
a9d84ee to
d879efe
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.
What
Adds an
ExportedTypesRPC method to each language engine (C#, JavaScript, Go, Python) that enumerates the public types a set of own artifacts (assemblies / package directories / module directories) export into OpenRewriteJavaType.This lets a caller read a dependency's public API without re-parsing its sources.
Artifact-scoped resolution
The enumeration is a function of the artifact alone — the referenced packages are never enumerated:
.dll'sTypeRefFQNs directly, so a reference into an assembly that wasn't loaded still comes back as a shallow FQN class-ref rather thanUnknown(only the BCL is supplied, so primitives resolve).go.modrequires (in the module cache) to name cross-module references.How
The response streams and paginates:
getObjectuses).RpcReceiveQueuegains a streamingreceiveList(before, onChange, sink)overload so a client never materializes the whole list.Per-module
rewrite-coreRpcReceiveQueue.receiveListoverloadrewrite-csharpAssemblyTypeEnumerator(Roslyn)ExportedTypeshandler +CSharpRewriteRpc.exportedTypesrewrite-javascriptexportedTypes(TypeScript checker)JavaScriptRewriteRpc.exportedTypesrewrite-goExportedTypes(go/types)GoRewriteRpc.exportedTypesrewrite-pythonPythonRewriteRpc.exportedTypesTests