perf(validate): use lighter version

- Also fix `vim.validate()` for PUC Lua when showing errors for values
  that aren't string or number.
This commit is contained in:
Lewis Russell
2024-10-16 17:03:48 +01:00
committed by Lewis Russell
parent fa6ab0d909
commit 3f3e4837d5
19 changed files with 141 additions and 253 deletions

View File

@ -195,7 +195,7 @@ local _client_pull_namespaces = {}
---@param client_id integer The id of the LSP client
---@param is_pull boolean? Whether the namespace is for a pull or push client. Defaults to push
function M.get_namespace(client_id, is_pull)
vim.validate({ client_id = { client_id, 'n' } })
vim.validate('client_id', client_id, 'number')
local client = vim.lsp.get_client_by_id(client_id)
if is_pull then