icerpc / icerpc-csharp

A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
https://docs.icerpc.dev
Apache License 2.0
108 stars 13 forks source link

Support generating internal types for Slice constructs #544

Closed bentoi closed 3 years ago

bentoi commented 3 years ago

Today, it's not possible to make generated types "internal" C# types. All the generated types are "public".

This is an issue for Slic types defined in SlicDefinitions.ice or the protocol types from IceXProtocolDefinitions.ice. These types don't need to be public given that they are only used by the IceRpc implementation and aren't useful to an IceRpc application.

We should support a Slice attribute to allow changing the visibility of Slice generated types.

bernardnormier commented 3 years ago

This sounds fine.

pepone commented 3 years ago

So can we use[cs:internal] or is there a better option?

externl commented 3 years ago

What about something like [cs:visibility(public|private|internal|whatever)]

pepone commented 3 years ago

I guess is more flexible, but we never need public this is the default, private doesn't make sense for Slice generated types, is there anything other than internal that we want to use? if not I will just stick with the simpler cs:internal

pepone commented 3 years ago

Fixed in https://github.com/zeroc-ice/icerpc-csharp/commit/43970132160a6b6e30ffb9353d25f7ec08a0a6cc