diff options
| author | Ashkan Kiani <ashkan.k.kiani@gmail.com> | 2019-11-17 13:06:11 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-17 13:06:11 -0800 |
| commit | c1292d313ef81868ad829461bd6403106e80259e (patch) | |
| tree | bd3c9d173f4a62147c6500e752214986212e3f3e /lua | |
| parent | Refactor docgen and add package.json support (#29) (diff) | |
| download | nvim-lspconfig-c1292d313ef81868ad829461bd6403106e80259e.tar nvim-lspconfig-c1292d313ef81868ad829461bd6403106e80259e.tar.gz nvim-lspconfig-c1292d313ef81868ad829461bd6403106e80259e.tar.bz2 nvim-lspconfig-c1292d313ef81868ad829461bd6403106e80259e.tar.lz nvim-lspconfig-c1292d313ef81868ad829461bd6403106e80259e.tar.xz nvim-lspconfig-c1292d313ef81868ad829461bd6403106e80259e.tar.zst nvim-lspconfig-c1292d313ef81868ad829461bd6403106e80259e.zip | |
Fix docs and add util.once (#31)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim_lsp/bashls.lua | 4 | ||||
| -rw-r--r-- | lua/nvim_lsp/clangd.lua | 2 | ||||
| -rw-r--r-- | lua/nvim_lsp/pyls.lua | 4 | ||||
| -rw-r--r-- | lua/nvim_lsp/texlab.lua | 4 | ||||
| -rw-r--r-- | lua/nvim_lsp/util.lua | 5 |
5 files changed, 10 insertions, 9 deletions
diff --git a/lua/nvim_lsp/bashls.lua b/lua/nvim_lsp/bashls.lua index c34affef..a82e16a0 100644 --- a/lua/nvim_lsp/bashls.lua +++ b/lua/nvim_lsp/bashls.lua @@ -2,8 +2,6 @@ local skeleton = require 'nvim_lsp/skeleton' local util = require 'nvim_lsp/util' local lsp = vim.lsp -local cwd = vim.loop.cwd() - local server_name = "bashls" local bin_name = "bash-language-server" @@ -17,7 +15,7 @@ skeleton[server_name] = { default_config = { cmd = {"bash-language-server", "start"}; filetypes = {"sh"}; - root_dir = function() return cwd end; + root_dir = util.once(vim.loop.cwd()); log_level = lsp.protocol.MessageType.Warning; settings = {}; }; diff --git a/lua/nvim_lsp/clangd.lua b/lua/nvim_lsp/clangd.lua index 6ba349e5..c2a4d42b 100644 --- a/lua/nvim_lsp/clangd.lua +++ b/lua/nvim_lsp/clangd.lua @@ -17,6 +17,8 @@ skeleton.clangd = { description = [[ https://clang.llvm.org/extra/clangd/Installation.html +**NOTE:** Clang >= 9 is recommended! See [this issue for more](https://github.com/neovim/nvim-lsp/issues/23). + clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified as compile_commands.json or, for simpler projects, a compile_flags.txt. ]]; diff --git a/lua/nvim_lsp/pyls.lua b/lua/nvim_lsp/pyls.lua index c4691f5d..fac05197 100644 --- a/lua/nvim_lsp/pyls.lua +++ b/lua/nvim_lsp/pyls.lua @@ -2,13 +2,11 @@ local skeleton = require 'nvim_lsp/skeleton' local util = require 'nvim_lsp/util' local lsp = vim.lsp -local cwd = vim.loop.cwd() - skeleton.pyls = { default_config = { cmd = {"pyls"}; filetypes = {"python"}; - root_dir = function() return cwd end; + root_dir = util.once(vim.loop.cwd()); log_level = lsp.protocol.MessageType.Warning; settings = {}; }; diff --git a/lua/nvim_lsp/texlab.lua b/lua/nvim_lsp/texlab.lua index a9f35ee6..7580be3e 100644 --- a/lua/nvim_lsp/texlab.lua +++ b/lua/nvim_lsp/texlab.lua @@ -2,8 +2,6 @@ local skeleton = require 'nvim_lsp/skeleton' local util = require 'nvim_lsp/util' local lsp = vim.lsp -local cwd = vim.loop.cwd() - local texlab_build_status = vim.tbl_add_reverse_lookup { Success = 0; Error = 1; @@ -37,7 +35,7 @@ skeleton.texlab = { default_config = { cmd = {"texlab"}; filetypes = {"tex", "bib"}; - root_dir = function() return cwd end; + root_dir = util.once(vim.loop.cwd()); log_level = lsp.protocol.MessageType.Warning; settings = { latex = { diff --git a/lua/nvim_lsp/util.lua b/lua/nvim_lsp/util.lua index a9ca5680..19d0c250 100644 --- a/lua/nvim_lsp/util.lua +++ b/lua/nvim_lsp/util.lua @@ -366,5 +366,10 @@ function M.utf8_config(config) return config end +-- Returns a function which returns the same value forever. +function M.once(value) + return function() return value end +end + return M -- vim:et ts=2 sw=2 |
