Skip to content

Source generate proxies for RpcMarshalable interfaces#1246

Merged
AArnott merged 1 commit intomainfrom
proxies-for-rpc-marshalable
Aug 12, 2025
Merged

Source generate proxies for RpcMarshalable interfaces#1246
AArnott merged 1 commit intomainfrom
proxies-for-rpc-marshalable

Conversation

@AArnott
Copy link
Copy Markdown
Member

@AArnott AArnott commented Aug 12, 2025

This might have been as simple as source generating proxies for the additional attribute (changes in ProxyGenerator.cs), except that marshalable interfaces exercise several patterns that our standard RPC interface tests didn't cover, so several bugs had to be fixed.

This might have been as simple as source generating proxies for the additional attribute (changes in ProxyGenerator.cs), except that marshalable interfaces exercise several patterns that our standard RPC interface tests didn't cover, so several bugs had to be fixed.
@AArnott AArnott added this to the v2.23 milestone Aug 12, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds source generation support for interfaces marked with the RpcMarshalable attribute, extending the existing proxy generation capability beyond just JsonRpcContract interfaces. The implementation fixes several bugs discovered during development related to patterns that marshalable interfaces exercise.

Key changes:

  • Added RpcMarshalable interfaces to proxy generation alongside JsonRpcContract interfaces
  • Enhanced proxy models to handle generic interfaces and invalid member detection
  • Fixed bugs in interface member handling and proxy generation patterns

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/StreamJsonRpc.Analyzers/ProxyGenerator.cs Added RpcMarshalable attribute provider and combined it with existing contract provider
src/StreamJsonRpc.Analyzers/GeneratorModels/ProxyModel.cs Enhanced to support generic types and detect invalid interfaces with unsupported members
src/StreamJsonRpc.Analyzers/GeneratorModels/InterfaceModel.cs Refactored to track unsupported member types and improved member categorization
src/StreamJsonRpc.Analyzers/GeneratorModels/EventModel.cs Fixed display format for event types
src/StreamJsonRpc/Reflection/MessageFormatterRpcMarshaledContextTracker.cs Updated collection initialization syntax
test/ files Added comprehensive test coverage for RpcMarshalable proxy generation scenarios

Comment thread src/StreamJsonRpc.Analyzers/GeneratorModels/ProxyModel.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants