diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-02-12 06:48:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 21:48:25 -0800 |
commit | 58ec72f9fdfd186e5154ce82be1da7c65b9c8ea0 (patch) | |
tree | af9b78ec40c1a76ca331db749e32f24f44fb75c6 /runtime/lua/vim/lsp.lua | |
parent | 5d5b068d5bdd2fe3787eb619097a5af08ef929e2 (diff) | |
download | rneovim-58ec72f9fdfd186e5154ce82be1da7c65b9c8ea0.tar.gz rneovim-58ec72f9fdfd186e5154ce82be1da7c65b9c8ea0.tar.bz2 rneovim-58ec72f9fdfd186e5154ce82be1da7c65b9c8ea0.zip |
LSP: rename validate_command to _cmd_parts #11847
and now only accepts a list of strings (instead of string or list).
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r-- | runtime/lua/vim/lsp.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 304686a816..e5b6653346 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -121,13 +121,9 @@ local function validate_encoding(encoding) or error(string.format("Invalid offset encoding %q. Must be one of: 'utf-8', 'utf-16', 'utf-32'", encoding)) end -local function validate_command(input) +function lsp._cmd_parts(input) local cmd, cmd_args - if type(input) == 'string' then - -- Use a shell to execute the command if it is a string. - cmd = vim.api.nvim_get_option('shell') - cmd_args = {vim.api.nvim_get_option('shellcmdflag'), input} - elseif vim.tbl_islist(input) then + if vim.tbl_islist(input) then cmd = input[1] cmd_args = {} -- Don't mutate our input. @@ -138,7 +134,7 @@ local function validate_command(input) end end else - error("cmd type must be string or list.") + error("cmd type must be list.") end return cmd, cmd_args end @@ -166,7 +162,7 @@ local function validate_client_config(config) before_init = { config.before_init, "f", true }; offset_encoding = { config.offset_encoding, "s", true }; } - local cmd, cmd_args = validate_command(config.cmd) + local cmd, cmd_args = lsp._cmd_parts(config.cmd) local offset_encoding = valid_encodings.UTF16 if config.offset_encoding then offset_encoding = validate_encoding(config.offset_encoding) |