Hi Marc, thanks for the suggestions.
When I tried to run the LSP server I hit this error:
(import (codeberg.org/rgherdt/scheme-lsp-server lsp-server))
*** ERROR IN "../../../.gambit_userlib/codeberg.org/rgherdt/scheme-lsp-server/@/gambit/util.scm"@25.9 -- Duplicate import of identifier with-exception-handler
Strange, I don't get this exception (tried it with Gambit 4.9.4 and master). Are you using some flag to start gsi? Anyway, I removed the dependency on (scheme base) since it was not actually needed in gambit/util.
Regarding `guard` I looked at the file `gambit.scm` quickly and I found: [...]
Is there any reason for using `#t` instead of an `else` in the `guard` to catch all exceptions?
I had a problem with Guile that 'else' was not recognized. It turns out, I experienced that because (scheme base) was not included. I replaced all #t's by else's in guard calls, thx.
Also, there’s a more direct way in Gambit to get the value of a global variable and check if it is undefined:
(let ((val (##global-var-ref (##make-global-var identifier))))) (if (##unbound? val) …
Done.
I pushed the changes. Can you please try it again?
BTW, I have a question. Is there some way to trigger compilation during the install process with `gsi`? Currently I'm doing this with a script that compiles all modules separately, and then compiles the server. I also tried to statically build gambit-lsp-server, but didn't figure out how to do that properly. Not a big deal, but I would like to learn what's possible in this direction.
Best,
Ricardo