Emacs lsp-mode with purescript-language-server?

Has anyone gone through and set up https://github.com/emacs-lsp/lsp-mode with https://github.com/nwolverson/purescript-language-server?

In the past I tried a bit with https://github.com/joaotavora/eglot to some mixed results. I currently use psc-ide-emacs with some elisp functions written to make it a bit easier for me to use, but I have some various reasons to not want to use this plugin anymore.

3 Likes

I’ve started work on a fork of lsp-mode that adds purescript as an lsp-mode client. It’s actually mostly functional already, the only thing it lacks is auto-completion for stuff contained within fully qualified import modules – this is actually an issue with purescript-language-server itself though (I think). My fork is here if anyone is interested: https://github.com/vanceism7/lsp-mode

2 Likes

Tiny bump on this since I came across this while looking for answers. Turns out there’s a bug in the syntax table for purescript-mode where . is treated as a “symbol constituent” rather than “punctuation”. In turn, Emacs takes Array.so as the entire identifier to match against completion candidates rather than just so

A quick solution is:

(modify-syntax-entry ?. "." purescript-mode-syntax-table)

I think my purs-mode does this already.

2 Likes