mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 15:51:32 +00:00
fix(lua): vim.validate message param #33675
Problem:
vim.validate does not handle `message` param.
Solution:
Add the missing logic.
(cherry picked from commit 40351bbbbe)
This commit is contained in:
committed by
github-actions[bot]
parent
c753e70abb
commit
dc87a0d80a
@@ -457,7 +457,8 @@ lsp.config = setmetatable({ _configs = {} }, {
|
||||
--- @param cfg vim.lsp.Config
|
||||
__newindex = function(self, name, cfg)
|
||||
validate_config_name(name)
|
||||
validate('cfg', cfg, 'table')
|
||||
local msg = ('table (hint: to resolve a config, use vim.lsp.config["%s"])'):format(name)
|
||||
validate('cfg', cfg, 'table', msg)
|
||||
invalidate_enabled_config(name)
|
||||
self._configs[name] = cfg
|
||||
end,
|
||||
@@ -467,7 +468,8 @@ lsp.config = setmetatable({ _configs = {} }, {
|
||||
--- @param cfg vim.lsp.Config
|
||||
__call = function(self, name, cfg)
|
||||
validate_config_name(name)
|
||||
validate('cfg', cfg, 'table')
|
||||
local msg = ('table (hint: to resolve a config, use vim.lsp.config["%s"])'):format(name)
|
||||
validate('cfg', cfg, 'table', msg)
|
||||
invalidate_enabled_config(name)
|
||||
self[name] = vim.tbl_deep_extend('force', self._configs[name] or {}, cfg)
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user