diff options
Diffstat (limited to 'test/functional/plugin/lsp/semantic_tokens_spec.lua')
-rw-r--r-- | test/functional/plugin/lsp/semantic_tokens_spec.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/functional/plugin/lsp/semantic_tokens_spec.lua b/test/functional/plugin/lsp/semantic_tokens_spec.lua index 9babb080e7..7908c5d2e7 100644 --- a/test/functional/plugin/lsp/semantic_tokens_spec.lua +++ b/test/functional/plugin/lsp/semantic_tokens_spec.lua @@ -111,7 +111,6 @@ describe('semantic token highlighting', function() end) it('buffer is highlighted when attached', function() - insert(text) exec_lua([[ bufnr = vim.api.nvim_get_current_buf() vim.api.nvim_win_set_buf(0, bufnr) @@ -119,6 +118,8 @@ describe('semantic token highlighting', function() client_id = vim.lsp.start({ name = 'dummy', cmd = server.cmd }) ]]) + insert(text) + screen:expect { grid = [[ #include <iostream> | @@ -140,7 +141,6 @@ describe('semantic token highlighting', function() end) it('use LspTokenUpdate and highlight_token', function() - insert(text) exec_lua([[ vim.api.nvim_create_autocmd("LspTokenUpdate", { callback = function(args) @@ -157,6 +157,8 @@ describe('semantic token highlighting', function() client_id = vim.lsp.start({ name = 'dummy', cmd = server.cmd }) ]]) + insert(text) + screen:expect { grid = [[ #include <iostream> | @@ -178,17 +180,14 @@ describe('semantic token highlighting', function() end) it('buffer is unhighlighted when client is detached', function() - insert(text) - exec_lua([[ bufnr = vim.api.nvim_get_current_buf() vim.api.nvim_win_set_buf(0, bufnr) client_id = vim.lsp.start({ name = 'dummy', cmd = server.cmd }) - vim.wait(1000, function() - return #server.messages > 1 - end) ]]) + insert(text) + exec_lua([[ vim.notify = function() end vim.lsp.buf_detach_client(bufnr, client_id) @@ -332,13 +331,14 @@ describe('semantic token highlighting', function() end) it('buffer is re-highlighted when force refreshed', function() - insert(text) exec_lua([[ bufnr = vim.api.nvim_get_current_buf() vim.api.nvim_win_set_buf(0, bufnr) client_id = vim.lsp.start({ name = 'dummy', cmd = server.cmd }) ]]) + insert(text) + screen:expect { grid = [[ #include <iostream> | @@ -412,14 +412,13 @@ describe('semantic token highlighting', function() end) it('updates highlights with delta request on buffer change', function() - insert(text) - exec_lua([[ bufnr = vim.api.nvim_get_current_buf() vim.api.nvim_win_set_buf(0, bufnr) client_id = vim.lsp.start({ name = 'dummy', cmd = server.cmd }) ]]) + insert(text) screen:expect { grid = [[ #include <iostream> | @@ -598,7 +597,6 @@ describe('semantic token highlighting', function() end) it('does not send delta requests if not supported by server', function() - insert(text) exec_lua( [[ local legend, response, edit_response = ... @@ -627,6 +625,7 @@ describe('semantic token highlighting', function() edit_response ) + insert(text) screen:expect { grid = [[ #include <iostream> | @@ -1450,7 +1449,6 @@ int main() }, }) do it(test.it, function() - insert(test.text1) exec_lua(create_server_definition) exec_lua( [[ @@ -1487,6 +1485,8 @@ int main() test.response2 ) + insert(test.text1) + test.expected_screen1() local highlights = exec_lua([[ |