diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-08-10 09:56:34 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-10 09:56:34 +1000 |
commit | f7e416bc7fbb8b1bc17e180d5aeb2e4f00256bea (patch) | |
tree | 517ef875abed324587167c6001ac25be050dd7da /cli/tests/integration/lsp_tests.rs | |
parent | 2db381eba9768acf855219ec9560e20a62659994 (diff) |
feat(lsp): support clients which do not support disabled code actions (#11612)
Closes: #11610
Diffstat (limited to 'cli/tests/integration/lsp_tests.rs')
-rw-r--r-- | cli/tests/integration/lsp_tests.rs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index a27ebec45..518dfe850 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -2155,6 +2155,54 @@ fn lsp_code_actions_refactor() { } #[test] +fn lsp_code_actions_refactor_no_disabled_support() { + let mut client = init("initialize_params_ca_no_disabled.json"); + did_open( + &mut client, + json!({ + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "interface A {\n a: string;\n}\n\ninterface B {\n b: string;\n}\n\nclass AB implements A, B {\n a = \"a\";\n b = \"b\";\n}\n\nnew AB().a;\n" + } + }), + ); + let (maybe_res, maybe_err) = client + .write_request( + "textDocument/codeAction", + json!({ + "textDocument": { + "uri": "file:///a/file.ts" + }, + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 14, + "character": 0 + } + }, + "context": { + "diagnostics": [], + "only": [ + "refactor" + ] + } + }), + ) + .unwrap(); + assert!(maybe_err.is_none()); + assert_eq!( + maybe_res, + Some(load_fixture("code_action_response_no_disabled.json")) + ); + shutdown(&mut client); +} + +#[test] fn lsp_code_actions_deadlock() { let mut client = init("initialize_params.json"); client |