diff options
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() |