emacs-lsp-booster icon indicating copy to clipboard operation
emacs-lsp-booster copied to clipboard

Support for GDScript LSP

Open anonimitoraf opened this issue 11 months ago • 4 comments

Thanks for this awesome package @blahgeek

I've noticed that it doesn't apply to GDScript since it doesn't use the stdio

(lsp-register-client
 (make-lsp-client :new-connection (lsp-gdscript-tcp-connect-to-port)
                  :activation-fn (lsp-activate-on "gdscript")
                  :server-id 'gdscript))

In comparison to something like JS:

(lsp-register-client
 (make-lsp-client :new-connection
                  (lsp-stdio-connection (lambda ()
                                          (cons lsp-clients-deno-server
                                                lsp-clients-deno-server-args)))
...

Is it possible to support GDScript? I don't mind implementing it with a bit of guidance. Thanks!

anonimitoraf avatar Dec 08 '24 11:12 anonimitoraf

More context:

lsp-gdscript-tcp-connect-to-port is defined as:

(defun lsp-gdscript-tcp-connect-to-port ()
  "Define a TCP connection to language server."
  (list
   :connect (lambda (filter sentinel name _environment-fn _workspace)
              (let* ((host "localhost")
                     (port lsp-gdscript-port)
                     (tcp-proc (lsp--open-network-stream host port (concat name "::tcp"))))

                (set-process-query-on-exit-flag tcp-proc nil)
                (set-process-filter tcp-proc filter)
                (set-process-sentinel tcp-proc sentinel)
                (cons tcp-proc tcp-proc)))
   :test? (lambda () t)))

anonimitoraf avatar Dec 08 '24 11:12 anonimitoraf

Actually, on that note: I'm not sure if the GDScript LSP uses JSON in the first place :thinking:

anonimitoraf avatar Dec 08 '24 11:12 anonimitoraf

Hello,

see https://github.com/blahgeek/emacs-lsp-booster/pull/33

It's only experimental because I don't really use any language servers that use TCP transport and I'm not sure how should we do the elisp part for configuration. It would be great if you can help testing it.

blahgeek avatar Dec 21 '24 05:12 blahgeek

Hey @blahgeek, awesome! I'll test it out, thanks.

anonimitoraf avatar Dec 22 '24 11:12 anonimitoraf