diff options
| author | Antoine Gagné <AntoineGagne@users.noreply.github.com> | 2020-03-17 22:02:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-18 11:02:26 +0900 |
| commit | 5d6220bc25a68c31a99014d817604b6b5e8e9254 (patch) | |
| tree | 4bc7fd5e3ffce0738af81a014590b46dcc5b94f6 /lua/nvim_lsp/purescriptls.lua | |
| parent | [docgen] Update README.md (diff) | |
| download | nvim-lspconfig-5d6220bc25a68c31a99014d817604b6b5e8e9254.tar nvim-lspconfig-5d6220bc25a68c31a99014d817604b6b5e8e9254.tar.gz nvim-lspconfig-5d6220bc25a68c31a99014d817604b6b5e8e9254.tar.bz2 nvim-lspconfig-5d6220bc25a68c31a99014d817604b6b5e8e9254.tar.lz nvim-lspconfig-5d6220bc25a68c31a99014d817604b6b5e8e9254.tar.xz nvim-lspconfig-5d6220bc25a68c31a99014d817604b6b5e8e9254.tar.zst nvim-lspconfig-5d6220bc25a68c31a99014d817604b6b5e8e9254.zip | |
Add Purescript language server (#168)
* Add Purescript language server
Diffstat (limited to 'lua/nvim_lsp/purescriptls.lua')
| -rw-r--r-- | lua/nvim_lsp/purescriptls.lua | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lua/nvim_lsp/purescriptls.lua b/lua/nvim_lsp/purescriptls.lua new file mode 100644 index 00000000..82d8c1bc --- /dev/null +++ b/lua/nvim_lsp/purescriptls.lua @@ -0,0 +1,46 @@ +local configs = require 'nvim_lsp/configs' +local util = require 'nvim_lsp/util' + +local server_name = "purescriptls" +local bin_name = "purescript-language-server" + +local installer = util.npm_installer { + server_name = server_name; + packages = { "purescript", "purescript-language-server" }; + binaries = {bin_name, "purs"}; +} + +configs[server_name] = { + default_config = util.utf8_config { + cmd = {"purescript-language-server", "--stdio"}; + filetypes = {"purescript"}; + root_dir = util.root_pattern("spago.dhall", "bower.json"); + }; + on_new_config = function(new_config) + local install_info = installer.info() + if install_info.is_installed then + if type(new_config.cmd) == 'table' then + new_config.cmd[1] = install_info.binaries[bin_name] + else + new_config.cmd = {install_info.binaries[bin_name]} + end + end + end; + docs = { + vscode = "nwolverson.ide-purescript"; + description = [[ +https://github.com/nwolverson/purescript-language-server +`purescript-language-server` can be installed via `:LspInstall purescriptls` or by yourself with `npm` +```sh +npm install -g purescript-language-server +``` +]]; + default_config = { + root_dir = [[root_pattern("spago.dhall, bower.json")]]; + }; + }; +}; +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info + +-- vim:et ts=2 sw=2 |
