diff options
author | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
commit | 308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (patch) | |
tree | 35fe43e01755e0f312650667004487a44d6b7941 /test/functional/plugin/lsp/incremental_sync_spec.lua | |
parent | 96a00c7c588b2f38a2424aeeb4ea3581d370bf2d (diff) | |
parent | e8c94697bcbe23a5c7b07c292b90a6b70aadfa87 (diff) | |
download | rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.gz rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.bz2 rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.zip |
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'test/functional/plugin/lsp/incremental_sync_spec.lua')
-rw-r--r-- | test/functional/plugin/lsp/incremental_sync_spec.lua | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/test/functional/plugin/lsp/incremental_sync_spec.lua b/test/functional/plugin/lsp/incremental_sync_spec.lua index 4e3eddb960..4985da9cd7 100644 --- a/test/functional/plugin/lsp/incremental_sync_spec.lua +++ b/test/functional/plugin/lsp/incremental_sync_spec.lua @@ -207,16 +207,16 @@ describe('incremental synchronization', function() { range = { ['start'] = { - character = 0, - line = 1 + character = 11, + line = 0, }, ['end'] = { character = 0, line = 1 } }, - rangeLength = 0, - text = 'hello world\n' + rangeLength = 1, + text = '\nhello world\n' } } test_edit({"hello world"}, {"yyp"}, expected_text_changes, 'utf-16', '\n') @@ -226,19 +226,57 @@ describe('incremental synchronization', function() { range = { ['start'] = { + character = 11, + line = 0 + }, + ['end'] = { character = 0, line = 1 + } + }, + rangeLength = 1, + text = '\n\n' + } + } + test_edit({"hello world"}, {"o"}, expected_text_changes, 'utf-16', '\n') + end) + it('adding a line to an empty buffer', function() + local expected_text_changes = { + { + range = { + ['start'] = { + character = 0, + line = 0 }, ['end'] = { character = 0, line = 1 } }, + rangeLength = 1, + text = '\n\n' + } + } + test_edit({""}, {"o"}, expected_text_changes, 'utf-16', '\n') + end) + it('insert a line above the current line', function() + local expected_text_changes = { + { + range = { + ['start'] = { + character = 0, + line = 0 + }, + ['end'] = { + character = 0, + line = 0 + } + }, rangeLength = 0, text = '\n' } } - test_edit({"hello world"}, {"o"}, expected_text_changes, 'utf-16', '\n') + test_edit({""}, {"O"}, expected_text_changes, 'utf-16', '\n') end) end) describe('multi line edit', function() |