fix(lsp): fix rename capability checks and multi client support (#18441)

Adds filter and id options to filter the client to use for rename.
Similar to the recently added `format` function.

rename will use all matching clients one after another and can handle a
mix of prepareRename/rename support. Also ensures the right
`offset_encoding` is used for the `make_position_params` calls
This commit is contained in:
Mathias Fußenegger
2022-05-05 23:56:00 +02:00
committed by GitHub
parent d14d308ce8
commit 55187de115
4 changed files with 124 additions and 44 deletions

View File

@@ -2636,10 +2636,8 @@ describe('LSP', function()
name = "prepare_rename_error",
expected_handlers = {
{NIL, {}, {method="shutdown", client_id=1}};
{NIL, NIL, {method="textDocument/rename", client_id=1, bufnr=1}};
{NIL, {}, {method="start", client_id=1}};
},
expected_text = "two", -- see test case
},
}) do
it(test.it, function()