Skip to content

Draft: Add VAPI generation

Aylam requested to merge aylamz/gnome-builder:vapi into main

This PR adds .vapi generation for libide. Marked as draft because there are still issues to be figured out. Currently when generating the .vapi file, it outputs the following:

Ide-48.gir:3250:11-3260:10: warning: Synchronous out-parameters are not supported in async methods
Ide-48.gir:33757:7-33758:85: warning: Creation method of abstract class cannot be public.
Ide-48.gir:34270:7-34270:70: warning: Signal `Ide.InstallButton.cancel' conflicts with method of the same name
Ide-48.gir:70081:7-70081:35: warning: Virtual method `Ide.TreeAddin.build_children' conflicts with method of the same name
Ide-48.gir:73636:7-73636:41: warning: Virtual method `Ide.TweaksBinding.get_expected_type' conflicts with method of the same name
Ide-48.gir:35892:7-35896:24: error: Type and/or accessors of overriding property `Ide.LspCodeAction.title' do not match overridden property `Ide.CodeAction.title': incompatible set accessor.
Ide-48.gir:71822:7-71824:22: error: overriding method `Ide.TreeNode.get_item' is incompatible with base method `GLib.Object? GLib.ListModel.get_item (uint)': Base method expected return type `GLib.Object?', but `void*' was provided.

There are some warnings and 2 errors. The first error is seemingly caused by the param flags of Ide.CodeAction.tile (readable) and Ide.LspCodeAction.title (readable, writable and construct-only) not matching. I am unsure if this is a bug in LibIde or if this is intentional and something that is not supported by Vala's vapigen.

The second error, I think, is caused by vapigen thinking that Ide.TreeNode.get_item is overriding GLib.ListModel.get_item even though (from looking at the code) it isn't. I am assuming that renaming get_item on Ide.TreeNode so that it doesn't collide with get_item on GLib.ListModel would fix this but that's perhaps not an ideal solution.

Not sure about the warnings.

Also: should generating the .vapi file be a Meson option?

Merge request reports

Loading