Hello, I’m happy to announce the first public alpha for the PureScript Analyzer! The analyzer can now be installed as a language server executable, with initial support for Visual Studio Code and Neovim.
Features (so far)
- Auto-completion
- Hover information
- Jump to definition
Installation
You can find pre-built binaries in the v0.0.5 release, alternatively, you may also build from source if you have Rust tooling installed:
cargo install --git https://github.com/purefunctor/purescript-analyzer --bin purescript-analyzer
Visual Studio Code
I’ve published an initial extension for Visual Studio Code, it should also work for Visual Studio Code forks (e.g. Cursor etc) but I’m not familiar with how they pull in extensions from Microsoft’s marketplace.
Neovim
You’ll need to add the following configuration to your init file (or similar)
vim.lsp.config("purescript_analyzer", {
cmd = { "purescript-analyzer" },
filetypes = { "purescript" },
root_markers = { "output", "spago.lock" },
})
vim.lsp.enable("purescript_analyzer")
Additional information
For now, the analyzer relies on spago.lock files produced by spago@next
to determine package locations and where to find modules from. If there’s enough interest, I can develop the following:
- The ability to provide custom source locations
- Compatibility with legacy spago (spago.dhall)
Support / Bugs
The analyzer is in its early alpha stages, so bugs will occur! Please report them through the repository.