diff options
| -rw-r--r-- | lua/mason-lspconfig/server_configurations/pylsp/init.lua | 2 | ||||
| -rw-r--r-- | tests/mason-lspconfig/setup_spec.lua | 23 |
2 files changed, 22 insertions, 3 deletions
diff --git a/lua/mason-lspconfig/server_configurations/pylsp/init.lua b/lua/mason-lspconfig/server_configurations/pylsp/init.lua index 9626fdc..8d8254f 100644 --- a/lua/mason-lspconfig/server_configurations/pylsp/init.lua +++ b/lua/mason-lspconfig/server_configurations/pylsp/init.lua @@ -33,7 +33,7 @@ return function(install_dir) end) end), { - desc = "[mason.nvim] Installs the provided packages in the same venv as pylsp.", + desc = "[mason-lspconfig.nvim] Installs the provided packages in the same venv as pylsp.", nargs = "+", complete = _.always { "pyls-flake8", diff --git a/tests/mason-lspconfig/setup_spec.lua b/tests/mason-lspconfig/setup_spec.lua index 013fa1e..4bfc3eb 100644 --- a/tests/mason-lspconfig/setup_spec.lua +++ b/tests/mason-lspconfig/setup_spec.lua @@ -167,8 +167,27 @@ describe("mason-lspconfig setup_handlers", function() } assert.spy(vim.notify).was_called(1) assert.spy(vim.notify).was_called_with( - "[mason.nvim] mason-lspconfig.setup_handlers: Received handler for unknown lspconfig server name: doesnt_exist_server.", - vim.log.levels.WARN + "mason-lspconfig.setup_handlers: Received handler for unknown lspconfig server name: doesnt_exist_server.", + vim.log.levels.WARN, + { title = "mason.nvim" } + ) + end) + + it("should print warning when providing invalid server entries in ensure_installed", function() + spy.on(vim, "notify") + mason_lspconfig.setup { + ensure_installed = { "yamllint", "hadolint" }, + } + assert.spy(vim.notify).was_called(2) + assert.spy(vim.notify).was_called_with( + [[[mason-lspconfig.nvim] Server "yamllint" is not a valid entry in ensure_installed. Make sure to only provide lspconfig server names.]], + vim.log.levels.WARN, + { title = "mason.nvim" } + ) + assert.spy(vim.notify).was_called_with( + [[[mason-lspconfig.nvim] Server "hadolint" is not a valid entry in ensure_installed. Make sure to only provide lspconfig server names.]], + vim.log.levels.WARN, + { title = "mason.nvim" } ) end) end) |
