Open vixalien opened 3 weeks ago
Another idea would be to add annotations upstream so other bindings can benefit and do not need to add heuristics, too.
Yeah. We would likely need to create an initiative to add these annotations. Would be better as a coordinated effort imo.
My philosophy is to do it on a case by case basis. I started adding some ref-func
annotations upstream because my project would benefit from it.
If some async function annotations are missing the specifically requested ones would be added by myself. Fixing all the annotations in a big effort would probably add a lot of burden to the maintainers of the upstream libraries and on the own binding project, too.
I just wanted to mention the annotations as from my point of view they are technically the better solution to the problem of missing async functions.
At least for my C# bindings I decided to not add more heuristics but to fix upstream instead.
Hello.
When using types generated by ts-for-gir 4.x, I found that some functions are not being detected as async/finish functions.
Functions with a signature resembling
function_name_async
and thenfunction_name_finish
seem to be generated correctly, but functions with a signature resemblingfunction_name
and thenfunction_name_finish
don't seem to be generated correctly.Some examples include:
Gtk.FileDialog.open_multiple
Gtk.ColorDialog.choose_rgba
Xdp.Camera.access_portal
Xdp.Portal.pick_color
Gtk.FileDialog.open
Xdp.Portal.session_monitor_start
Xdp.Portal.*
functionsA possible way to detect these would be to check if a function's last parameter is a
Gio.AsyncReadyCallback
, and then detecting if there's a similar function with_finish
suffix AND which takes in aGio.AsyncResult
as only parameter.