techee / geany-lsp

LSP plugin for the Geany editor
GNU General Public License v2.0
11 stars 1 forks source link

LSP plugin not in plugin manager #6

Closed elextr closed 9 months ago

elextr commented 9 months ago

Cloned, built installed with meson, there is a lsp.so in lib/x86_64-linux-gnu with filebrowser and other core plugins, they appear in plugin manager, lsp does not.

Message in debug messages:

18:50:33: Geany INFO        : Can't load plugin: /home/lex/geany_lsp/geany-lsp/lib/x86_64-linux-gnu/geany/lsp.so: undefined symbol: JSONRPC_MESSAGE_PUT_VARIANT

Is there a specific version of json-rpc needed, have 3.34.0?

Scrolling waaaay back in the build I found:

../plugins/lsp/lsp-server.c:506:4: warning: implicit declaration of function ‘JSONRPC_MESSAGE_PUT_VARIANT’; did you mean ‘JSONRPC_MESSAGE_GET_VARIANT’? [-Wimplicit-function-declaration]
  506 |    JSONRPC_MESSAGE_PUT_VARIANT(get_init_options(server)),
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Dear olde C, thinking a macro is a function, sigh!!!

Seems like it needs to be 3.42 AFAICT, you might check.

techee commented 9 months ago

Yay, someone trying the plugin finally :-). I'm interested in any feedback - for instance I think there's a lot of room for optimizing the code, I didn't do much in this respect because things seemed to run fine on my machine but I can imagine some projects where it might not be OK so if you run into some performance (or any other) problems, just let me know.

In the meantime, I also implemented basic support for semantic tokens so you'll get typenams colorized from LSP too. At this point I think I have the complete necessary API for Geany - none of the other LSP features have Geany-provided counterparts and it should be possible to implement them independently of Geany (since the whole Scintilla is part of Geany's API)


Back to the report, yes, JSONRPC_MESSAGE_PUT_VARIANT() appears to be in newer versions of the library only. Anyway, this is only used to pass possible user-defined configuration to the server (and only some servers support it, I'm not sure if clangd is one of them), so this part can be #if 0'd for now.

Fixed in master now.

techee commented 9 months ago

In the meantime, I also implemented basic support for semantic tokens

Just for completeness, symbol tree is also generated using LSP now.