diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/api.txt | 3 | ||||
-rw-r--r-- | runtime/doc/lsp.txt | 2 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/buf.lua | 13 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 2 |
4 files changed, 12 insertions, 8 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 242546f87d..50fe60a0fc 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1782,8 +1782,7 @@ nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()* item was specified and two elements if both range items were specified. • count: (number) Any |<count>| that was supplied to the - command. -1 if command cannot take a count. Mutually - exclusive with "range". + command. -1 if command cannot take a count. • reg: (number) The optional command |<register>|, if specified. Empty string if not specified or if command cannot take a register. diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index be46bbfa66..299efe5bf6 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1703,7 +1703,7 @@ open_floating_preview({contents}, {syntax}, {opts}) • width: (number) width of floating window • wrap: (boolean, default true) wrap long lines - • wrap_at: (string) character to wrap at for + • wrap_at: (number) character to wrap at for computing height when wrap is enabled • max_width: (number) maximal width of floating window diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index 8db215829f..6666b3c044 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -383,8 +383,14 @@ function M.rename(new_name, options) ) end + -- Clients must at least support rename, prepareRename is optional + clients = vim.tbl_filter( + function(client) return client.supports_method("textDocument/rename") end, + clients + ) + if #clients == 0 then - vim.notify("[LSP] Rename request failed, no matching language servers.") + vim.notify("[LSP] Rename, no matching language servers with rename capability.") end local win = vim.api.nvim_get_current_win() @@ -459,7 +465,8 @@ function M.rename(new_name, options) rename(input) end) end, bufnr) - elseif client.supports_method("textDocument/rename") then + else + assert(client.supports_method("textDocument/rename"), 'Client must support textDocument/rename') if new_name then rename(new_name) return @@ -475,8 +482,6 @@ function M.rename(new_name, options) end rename(input) end) - else - vim.notify('Client ' .. client.id .. '/' .. client.name .. ' has no rename capability') end end diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 72dfb3cd76..bb87e8372b 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1384,7 +1384,7 @@ end --- - height: (number) height of floating window --- - width: (number) width of floating window --- - wrap: (boolean, default true) wrap long lines ---- - wrap_at: (string) character to wrap at for computing height when wrap is enabled +--- - wrap_at: (number) character to wrap at for computing height when wrap is enabled --- - max_width: (number) maximal width of floating window --- - max_height: (number) maximal height of floating window --- - pad_top: (number) number of lines to pad contents at top |