diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-04-14 10:39:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-14 10:39:57 +0200 |
commit | 4d04feb6629cb049cb2a13ba35f0c8d3c6b67ff4 (patch) | |
tree | 17dadca32fa46116a9c576fc651a61bc5da8ece4 /runtime/lua/vim/lsp/codelens.lua | |
parent | 72a327cad20fa2dbb214177cc48c533543d5b9e8 (diff) | |
download | rneovim-4d04feb6629cb049cb2a13ba35f0c8d3c6b67ff4.tar.gz rneovim-4d04feb6629cb049cb2a13ba35f0c8d3c6b67ff4.tar.bz2 rneovim-4d04feb6629cb049cb2a13ba35f0c8d3c6b67ff4.zip |
feat(lua): vim.tbl_contains supports general tables and predicates (#23040)
* feat(lua): vim.tbl_contains supports general tables and predicates
Problem: `vim.tbl_contains` only works for list-like tables (integer
keys without gaps) and primitive values (in particular, not for nested
tables).
Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new
`vim.tbl_contains` that works for general tables and optionally allows
`value` to be a predicate function that is checked for every key.
Diffstat (limited to 'runtime/lua/vim/lsp/codelens.lua')
-rw-r--r-- | runtime/lua/vim/lsp/codelens.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua index 81cac6a511..005a0047fa 100644 --- a/runtime/lua/vim/lsp/codelens.lua +++ b/runtime/lua/vim/lsp/codelens.lua @@ -42,7 +42,7 @@ local function execute_lens(lens, bufnr, client_id) -- Need to use the client that returned the lens → must not use buf_request local command_provider = client.server_capabilities.executeCommandProvider local commands = type(command_provider) == 'table' and command_provider.commands or {} - if not vim.tbl_contains(commands, command.command) then + if not vim.list_contains(commands, command.command) then vim.notify( string.format( 'Language server does not support command `%s`. This command may require a client extension.', |