Closed wkirschbaum closed 1 year ago
So the server is not advertising that it supports the document symbol capability, so the client should not be sending the request.
Sure, but when is it a good idea to trust a client to not crash the server?
On Thu, 20 Apr 2023, 13:06 Mitchell Hanberg, @.***> wrote:
So the server is not advertising that it supports the document symbol capability, so the client should not be sending the request.
— Reply to this email directly, view it on GitHub https://github.com/elixir-tools/credo-language-server/issues/8#issuecomment-1516137356, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK5POYP4VZLHMCNHRAOLJDXCEKDVANCNFSM6AAAAAAXFETRTU . You are receiving this because you authored the thread.Message ID: @.***>
This is eglot in emacs, will have a look there too.
On Thu, 20 Apr 2023, 13:10 Wilhelm Kirschbaum, @.***> wrote:
Sure, but when is it a good idea to trust a client to not crash the server?
On Thu, 20 Apr 2023, 13:06 Mitchell Hanberg, @.***> wrote:
So the server is not advertising that it supports the document symbol capability, so the client should not be sending the request.
— Reply to this email directly, view it on GitHub https://github.com/elixir-tools/credo-language-server/issues/8#issuecomment-1516137356, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK5POYP4VZLHMCNHRAOLJDXCEKDVANCNFSM6AAAAAAXFETRTU . You are receiving this because you authored the thread.Message ID: @.***>
Sure, but when is it a good idea to trust a client to not crash the server?
Fair point, but I'm just saying the protocol specifies these capabilities just for this reason and most other LSP clients seem to handle it fine.
Let me take another look at the protocol to see what it says about how to handle a situation like this.
I think I know the change I need to make, I'll push that up shortly
I will submit a patch to emacs for this if i can spot the bug there, but thanks for having a look.
I am not sure about your config but could possibly make sure you don't have a plug-in that is the culprit.
This is core emacs with no strange config options. I have not seen this issue with other language servers I use.
@wkirschbaum would you mind trying out the branch on #15 and let me know if it works?
@mhanberg thanks. I am not getting the same error, but have timeouts after 30 seconds. This was observed before on larger projects, but happening on smaller ones on this branch as well. I will investigate a bit more and log an issue a bit later.
@wkirschbaum Would you be able to share with me a minimal emacs eglot config to get me started? Would probably help figure this out faster
For testing I use the following:
(require 'eglot)
(require 'heex-ts-mode)
(require 'elixir-ts-mode)
(setq eglot-server-programs `((elixir-ts-mode . ("~/src/elixir/credo-language-server/bin/credo-language-server"))))
;; or
(setq eglot-server-programs `((elixir-ts-mode . ("localhost" 9000))))
(add-hook 'elixir-ts-mode-hook 'eglot-ensure)
(add-hook 'heex-ts-mode-hook 'eglot-ensure)
you can use it with elixir-mode as well from melpa and would look like this:
(require 'eglot)
(setq eglot-server-programs `((elixir-ts-mode . ("localhost" 9000))))
(add-hook 'elixir-mode-hook 'eglot-ensure)
I am currently using only core emacs on the master branch, compiled with tree-sitter.
Unless you are comfortable with Emacs I dont want to burden you with debugging, I will get to it soonish :)
@wkirschbaum i'm calling the original issue fixed by #15.
Please open a new issue once you narrow down the new problem you're having with eglot.
Thanks again!
When hooking up to Emac's lsp program called eglot, the server crashes when trying to handle the following request:
The following change fixes it for me locally: