diff options
author | hrsh7th <hrsh7th@gmail.com> | 2022-01-13 18:28:13 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 10:28:13 +0100 |
commit | 43ef7df22d58a72e8b155265620f6c030900812e (patch) | |
tree | c57a4c97aec8af97b8abf3f1c017fd918e6b0330 /test/functional | |
parent | f9b3b2dcfc199c212634e4d53bc6f7d3b6486aea (diff) | |
download | rneovim-43ef7df22d58a72e8b155265620f6c030900812e.tar.gz rneovim-43ef7df22d58a72e8b155265620f6c030900812e.tar.bz2 rneovim-43ef7df22d58a72e8b155265620f6c030900812e.zip |
fix(lsp): fix applying multiple out-of-range TextEdits (#17037)
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index 7ad1a52fe3..6a4730c5ac 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -1375,6 +1375,20 @@ describe('LSP', function() 'foobar'; }, buf_lines(1)) end) + it('applies multiple text edits at the end of the document', function() + local edits = { + make_edit(4, 0, 5, 0, ""); + make_edit(5, 0, 5, 0, "foobar"); + } + exec_lua('vim.lsp.util.apply_text_edits(...)', edits, 1) + eq({ + 'First line of text'; + 'Second line of text'; + 'Third line of text'; + 'Fourth line of text'; + 'foobar'; + }, buf_lines(1)) + end) describe('cursor position', function() it('don\'t fix the cursor if the range contains the cursor', function() |