so i wanted to use an language server in gnome-builder, and i looked at the definition for the go lsp, and more or less copied it into a plugin file:
[Plugin]
Copyright=2024
Description=Language server integration for the OCaml programming language
Embedded=ide_lsp_plugin_register_types
Module=ocaml-lsp
Name=OCaml Language Server
X-Category=lsps
X-Code-Action-Languages=ocaml
X-Completion-Provider-Languages=ocaml
X-Diagnostic-Provider-Languages=ocaml
X-Formatter-Languages=ocaml
X-Highlighter-Languages=ocaml
X-Hover-Provider-Languages=ocaml
X-LSP-Command=ocaml-lsp-server
X-LSP-Languages=ocaml
X-LSP-Settings=ocaml-settings.json
X-Rename-Provider-Languages=ocaml
X-Symbol-Resolver-Languages=ocaml
X-Builder-ABI=46
but i am getting this error:
libpeas[ 2]: WARNING: Bad plugin file '/home/user/.var/app/org.gnome.Builder/data/gnome-builder/plugins/ocaml-lsp/ocaml-lsp.plugin': embedded plugins must be a resource
why is this? how do i tell it to load this plugin as an lsp?
IIRC “embedded” is effectively “statically linked”, which I guess is why it’s required to be a resource (GResource’s are typically statically linked). Removing that should help.
doesn’t that specify what function should be called to load the plugin?
with it removed i get: libpeas[ 2]: WARNING: Failed to load module 'ocaml-lsp': /home/user/.var/app/org.gnome.Builder/data/gnome-builder/plugins/libocaml-lsp.so: cannot open shared object file: No such file or directory
Ah, I see the LSP plugin is built-in and expects ide_lsp_plugin_register_types() to be called to register it. You may have to call ide_lsp_plugin_register_types() from peas_register_types()?