mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(lua): vim.validate message
param #33675
Problem: vim.validate does not handle `message` param. Solution: Add the missing logic.
This commit is contained in:
@ -475,7 +475,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,
|
||||
@ -485,7 +486,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