This is what I get for sticking my head above the parapet!
The Neovim packaging ecosystem is evolving quite rapidly at the moment, and I wouldn’t want to pretend that I’m an expert. I just spent a couple of weeks recently migrating an ancient, encrusted, decades-old ‘classic’ vim configuration into the newer lua-based Neovim system, and took the opportunity to get up to speed with some of the latest features that seemed useful. LSP support was probably the main new feature that was a real upgrade for me. (Despite the fact that I then had to argue with the R LSP because the tidyverse and I don’t quite see eye-to-eye on how to format code…)
nvim-lspconfig is a package that provides configurations for different LSPs. Mason is a package manager for Neovim that seems to be the most common way to install LSPs and keep them up to date. It has a fairly extensive list of supported LSPs, and a sub-package, mason-lspconfigthat handles enabling installed LSPs for the nvim-lspconfigplugin. (The extra convenience here is that if you copy your Neovim configuration to a new machine, when you open it up then it will automatically download, install, and configure all the LSPs you’ve specified in your configuration.)
So, if my understanding of all this is right:
- Neovim includes an LSP client.
- Mason is what you use to install and update LSPs to avoid doing it all manually.
nvim-lspconfigis what you use to have configurations for all your LSPs automatically available.
mason-lspconfig is used to tell nvim-lspconfigabout LSPs installed via Mason, and enable them automatically as required.
(I think!)
Despite that all sounding quite complicated, my understanding is that a creating a config to go into nvim-lspconfig isn’t too hard, and adding an LSP to Mason’s list is apparently a fairly short .yaml file. I’ve never done any of that before, though, so I could be wildly underestimating it.
I will say that, even though there’s quite a flurry of developments and packages at the moment, all of the ones I’ve listed here seem to be quite core elements of the way things are now done, so I’m not worried that anything I’ve said here is likely to change fundamentally in the near future.
I very much want to have the Stan LSP working in my config, though, so I’ve got every incentive to work all this out. If I can get everything together, I’ll happily report back and submit the appropriate PRs to Mason/nvim-lspconfig and write some updated install documentation for the github page.