diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /test/functional/fixtures/fake-lsp-server.lua | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/fixtures/fake-lsp-server.lua')
-rw-r--r-- | test/functional/fixtures/fake-lsp-server.lua | 62 |
1 files changed, 53 insertions, 9 deletions
diff --git a/test/functional/fixtures/fake-lsp-server.lua b/test/functional/fixtures/fake-lsp-server.lua index db0c8c0c3f..0db9265a29 100644 --- a/test/functional/fixtures/fake-lsp-server.lua +++ b/test/functional/fixtures/fake-lsp-server.lua @@ -272,6 +272,7 @@ function tests.text_document_save_did_open() end; body = function() notify('start') + expect_notification('textDocument/didClose') expect_notification('textDocument/didOpen') expect_notification('textDocument/didSave') notify('shutdown') @@ -787,6 +788,9 @@ function tests.code_action_server_side_command() codeActionProvider = { resolveProvider = false, }, + executeCommandProvider = { + commands = {"dummy1"} + }, }, } end, @@ -830,21 +834,21 @@ function tests.code_action_filter() isPreferred = true, command = 'preferred_command', } - local quickfix_action = { + local type_annotate_action = { title = 'Action 3', - kind = 'quickfix', - command = 'quickfix_command', + kind = 'type-annotate', + command = 'type_annotate_command', } - local quickfix_foo_action = { + local type_annotate_foo_action = { title = 'Action 4', - kind = 'quickfix.foo', - command = 'quickfix_foo_command', + kind = 'type-annotate.foo', + command = 'type_annotate_foo_command', } expect_request('textDocument/codeAction', function() - return nil, { action, preferred_action, quickfix_action, quickfix_foo_action, } + return nil, { action, preferred_action, type_annotate_action, type_annotate_foo_action, } end) expect_request('textDocument/codeAction', function() - return nil, { action, preferred_action, quickfix_action, quickfix_foo_action, } + return nil, { action, preferred_action, type_annotate_action, type_annotate_foo_action, } end) notify('shutdown') end; @@ -927,12 +931,52 @@ function tests.basic_formatting() } end +function tests.set_defaults_all_capabilities() + skeleton { + on_init = function(_) + return { + capabilities = { + definitionProvider = true, + completionProvider = true, + documentRangeFormattingProvider = true, + hoverProvider = true, + } + } + end; + body = function() + notify('test') + end; + } +end + +function tests.inlay_hint() + skeleton { + on_init = function(params) + local expected_capabilities = protocol.make_client_capabilities() + assert_eq(params.capabilities, expected_capabilities) + return { + capabilities = { + inlayHintProvider = true; + } + } + end; + body = function() + notify('start') + expect_request('textDocument/inlayHint', function() + return nil, {} + end) + expect_notification("finish") + notify('finish') + end; + } +end + -- Tests will be indexed by test_name local test_name = arg[1] local timeout = arg[2] assert(type(test_name) == 'string', 'test_name must be specified as first arg.') -local kill_timer = vim.loop.new_timer() +local kill_timer = vim.uv.new_timer() kill_timer:start(timeout or 1e3, 0, function() kill_timer:stop() kill_timer:close() |