aboutsummaryrefslogtreecommitdiffstats
path: root/test/lspconfig_spec.lua
diff options
context:
space:
mode:
authorRaphael <glepnir@neovim.pro>2022-08-26 21:25:39 +0800
committerGitHub <noreply@github.com>2022-08-26 21:25:39 +0800
commitb89530f9f8783f19a172ed3a94fca2ba993c653b (patch)
tree2a9055c08a510645684ea521e9c7142f41fb89dd /test/lspconfig_spec.lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-b89530f9f8783f19a172ed3a94fca2ba993c653b.tar
nvim-lspconfig-b89530f9f8783f19a172ed3a94fca2ba993c653b.tar.gz
nvim-lspconfig-b89530f9f8783f19a172ed3a94fca2ba993c653b.tar.bz2
nvim-lspconfig-b89530f9f8783f19a172ed3a94fca2ba993c653b.tar.lz
nvim-lspconfig-b89530f9f8783f19a172ed3a94fca2ba993c653b.tar.xz
nvim-lspconfig-b89530f9f8783f19a172ed3a94fca2ba993c653b.tar.zst
nvim-lspconfig-b89530f9f8783f19a172ed3a94fca2ba993c653b.zip
Revert "fix: remove the config.commands (#2092)" (#2093)
This reverts commit 99e0dc9937b124dee7d8107185e804ff96466279.
Diffstat (limited to 'test/lspconfig_spec.lua')
-rw-r--r--test/lspconfig_spec.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/lspconfig_spec.lua b/test/lspconfig_spec.lua
index 7bee8ceb..f98568c1 100644
--- a/test/lspconfig_spec.lua
+++ b/test/lspconfig_spec.lua
@@ -213,6 +213,41 @@ describe('lspconfig', function()
]])
end)
end)
+
+ describe('user commands', function()
+ it('should translate command definition to nvim_create_user_command options', function()
+ eq(
+ {
+ nargs = '*',
+ complete = 'custom,v:lua.some_global',
+ },
+ exec_lua [[
+ local util = require("lspconfig.util")
+ return util._parse_user_command_options({
+ function () end,
+ "-nargs=* -complete=custom,v:lua.some_global"
+ })
+ ]]
+ )
+
+ eq(
+ {
+ desc = 'My awesome description.',
+ nargs = '*',
+ complete = 'custom,v:lua.another_global',
+ },
+ exec_lua [[
+ local util = require("lspconfig.util")
+ return util._parse_user_command_options({
+ function () end,
+ ["-nargs"] = "*",
+ "-complete=custom,v:lua.another_global",
+ description = "My awesome description."
+ })
+ ]]
+ )
+ end)
+ end)
end)
describe('config', function()