affederaffe / Tmds.DBus.SourceGenerator

A roslyn source generator for creating proxies targeting the Tmds.DBus.Protocol API
MIT License
7 stars 5 forks source link

compile-error on handler generation for `Dictionary` #9

Closed ShortDevelopment closed 6 months ago

ShortDevelopment commented 6 months ago

I'm trying to generate the handler code for the org.bluez.LEAdvertisement1 interface containing some dictionary properties.

This is a snipped of the generated code trying to access Key and Value from the ManufacturerData dictionary instance:

case "ManufacturerData":
{
    MessageWriter writer = context.CreateReplyWriter("v");
    writer.WriteDBusVariant(new DBusVariantItem("a{qv}", new DBusDictEntryItem(new DBusUInt16Item(BackingProperties.ManufacturerData.Key), new DBusVariantItem(BackingProperties.ManufacturerData.Value))));
    context.Reply(writer.CreateMessage());
    writer.Dispose();
    break;
}
Introspection LEAdvertisement1 ```xml ```

Btw: Very nice library! ❤️

affederaffe commented 6 months ago

Thank you ^^ Do you mind testing with the latest CI build ? Seems like I messed up the parsing of dictionaries...

ShortDevelopment commented 6 months ago

I tried using v0.0.15 from github artifacts but it produced the same output.

affederaffe commented 6 months ago

MSBuild can be pretty aggressive with caching, so perhaps the new version wasn't used. I bumped the version which should prevent this, I'm sorry to ask again, but please try out this new version.

ShortDevelopment commented 6 months ago

It works!

Sorry for keeping you waiting so long, I'm very busy at the moment. I hadn't realized that v0.0.15 was also the latest version on Nuget, so msbuild fetched the version from Nuget instead of from my local directory.