diff options
| author | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-02-16 12:14:20 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-16 12:14:20 +0900 |
| commit | d84e2cb556cd5fe376754d43664fba0e31606888 (patch) | |
| tree | c305dac66cc0d647547254485a92c82d43624717 /lua | |
| parent | Merge pull request #119 from GenesisTMS/master (diff) | |
| parent | Add nimls (diff) | |
| download | nvim-lspconfig-d84e2cb556cd5fe376754d43664fba0e31606888.tar nvim-lspconfig-d84e2cb556cd5fe376754d43664fba0e31606888.tar.gz nvim-lspconfig-d84e2cb556cd5fe376754d43664fba0e31606888.tar.bz2 nvim-lspconfig-d84e2cb556cd5fe376754d43664fba0e31606888.tar.lz nvim-lspconfig-d84e2cb556cd5fe376754d43664fba0e31606888.tar.xz nvim-lspconfig-d84e2cb556cd5fe376754d43664fba0e31606888.tar.zst nvim-lspconfig-d84e2cb556cd5fe376754d43664fba0e31606888.zip | |
Merge pull request #122 from kdheepak/kd/add-nimls
Add nimls
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim_lsp/nimls.lua | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lua/nvim_lsp/nimls.lua b/lua/nvim_lsp/nimls.lua new file mode 100644 index 00000000..f4eb2e1e --- /dev/null +++ b/lua/nvim_lsp/nimls.lua @@ -0,0 +1,46 @@ +local configs = require 'nvim_lsp/configs' +local util = require 'nvim_lsp/util' + +configs.nimls = { + default_config = { + cmd = {"nimlsp",}; + filetypes = {'nim'}; + log_level = vim.lsp.protocol.MessageType.Warning; + root_dir = function(fname) + return util.find_git_ancestor(fname) or vim.loop.os_homedir() + end; + }; + docs = { + vscode = "kosz78.nim"; + description = [[ +https://github.com/PMunch/nimlsp +`nimlsp` can be installed via `:LspInstall nimls` or by yourself the `nimble` package manager: +```sh +nimble install nimlsp +``` + ]]; + default_config = { + root_dir = [[root_pattern(".git") or os_homedir]]; + }; + }; +} + +configs.nimls.install = function() + local script = [[ + nimble install nimlsp + ]] + + util.sh(script, vim.loop.os_homedir()) +end + +configs.nimls.install_info = function() + local script = [[ + nimlsp --version + ]] + + local status = pcall(vim.fn.system, script) + + return { + is_installed = status and vim.v.shell_error == 0; + } +end |
