NordSecurity / uniffi-bindgen-cs

C# bindings generator for uniffi-rs
https://github.com/NordSecurity/uniffi-bindgen-cs
Mozilla Public License 2.0
109 stars 21 forks source link

Ensure type names are generated uniformly independent of capitalization #28

Open tnull opened 1 year ago

tnull commented 1 year ago

I have a type declared as interface ASDFObject in my UDL file, which works without issue in Swift/Kotlin/Python.

When trying to generate CS bindings, the output file however includes

public class AsdfObjectSafeHandle: FFISafeHandle {

while the constructors then are defined as

public static extern ASDFObjectSafeHandle ... 

... which of course doesn't compile. If I switch the Rust/UDL type name to be AsdfObject everything seems to be generated uniformly, which I however would like to avoid.

arg0d commented 1 year ago

Good catch. Is the expected class name for your C# bindings class AsdfObject? Or should it be class ASDFObject?

tnull commented 1 year ago

Good catch. Is the expected class name for your C# bindings class AsdfObject? Or should it be class ASDFObject?

I honestly have no strong preference as long as it's consistent and roughly follows the target language's best practices. I'm not too familiar with C# so far, but from what I gathered AsdfObject seems to be the convention?