diff options
author | dundargoc <gocdundar@gmail.com> | 2024-04-02 15:45:19 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-04-04 13:10:11 +0200 |
commit | e016f5bee6293d126fde9e8d75a3f02f882e2c81 (patch) | |
tree | 05a21a41b1c0c934e6fbf508a213f222ad3a60c1 /test/functional/plugin/lsp/semantic_tokens_spec.lua | |
parent | 56701cd21e1ded488872fa82d2b56734495b1fe2 (diff) | |
download | rneovim-e016f5bee6293d126fde9e8d75a3f02f882e2c81.tar.gz rneovim-e016f5bee6293d126fde9e8d75a3f02f882e2c81.tar.bz2 rneovim-e016f5bee6293d126fde9e8d75a3f02f882e2c81.zip |
test: reduce `exec_lua` calls
`exec_lua` makes code slighly harder to read, so it's beneficial to
remove it in cases where it's possible or convenient.
Not all `exec_lua` calls should be removed even if the test passes as it
changes the semantics of the test even if it happens to pass.
From https://github.com/neovim/neovim/pull/28155#discussion_r1548185779:
"Note for tests like this, which fundamentally are about conversion, you
end up changing what conversion you are testing. Even if the result
happens to be same (as they often are, as we like the rules to be
consistent if possible), you are now testing the RPC conversion rules
instead of the vim script to in-process lua conversion rules."
From https://github.com/neovim/neovim/pull/28155#discussion_r1548190152:
"A test like this specifies that the cursor is valid immediately and not
after a separate cycle of normal (or an other input-processing) mode."
Diffstat (limited to 'test/functional/plugin/lsp/semantic_tokens_spec.lua')
-rw-r--r-- | test/functional/plugin/lsp/semantic_tokens_spec.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/functional/plugin/lsp/semantic_tokens_spec.lua b/test/functional/plugin/lsp/semantic_tokens_spec.lua index ad09ab08b3..12f6e09e7e 100644 --- a/test/functional/plugin/lsp/semantic_tokens_spec.lua +++ b/test/functional/plugin/lsp/semantic_tokens_spec.lua @@ -10,6 +10,7 @@ local feed = helpers.feed local feed_command = helpers.feed_command local insert = helpers.insert local matches = helpers.matches +local api = helpers.api local clear_notrace = lsp_helpers.clear_notrace local create_server_definition = lsp_helpers.create_server_definition @@ -19,7 +20,7 @@ before_each(function() end) after_each(function() - exec_lua("vim.api.nvim_exec_autocmds('VimLeavePre', { modeline = false })") + api.nvim_exec_autocmds('VimLeavePre', { modeline = false }) end) describe('semantic token highlighting', function() |