koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.16k stars 151 forks source link

LSP compatible with Eglot or lsp-mode #542

Open patrick-nicodemus opened 1 month ago

patrick-nicodemus commented 1 month ago

Hi,

I am an Emacs user and I was wondering if the language server is compatible with Eglot or lsp-mode out of the box?

I think in theory these tools will be compatible directly with any server implementing the LSP protocol. It could be very easy to get it working, I just wasn't able to figure it out immediately and wanted to see if anyone else had successfully gotten it working.

TimWhiting commented 1 month ago

You should be able to run koka with the arguments --language-server --lsstdio to run the language server communicating over stdin/stdout protocol, which is typically supported by language server clients.

patrick-nicodemus commented 4 weeks ago

Ok. I tried doing this and I got the message

[eglot] Connected! Server `EGLOT (syntax/nil)' now managing `nil' buffers in project `syntax'.

(where "syntax" is the folder in the samples directory containing basic syntax) However, any Eglot command issued after that returns the following error:

eglot--current-server-or-lose: jsonrpc-error: "No current JSON-RPC connection", (jsonrpc-error-code . -32603), (jsonrpc-error-message . "No current JSON-RPC connection")

I'm not sure what the problem is

(I used emacs -Q so there are no other addons enabled to interfere with it, just eglot and flymake)