diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-06-24 22:41:04 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 22:41:04 +1000 |
commit | 8ed83cba7e2eeabb3af1fd65579dacd782f50644 (patch) | |
tree | 30d93dbea20fd4a20cd5dc262a069fdcb456fdb0 /cli/tests/integration_tests_lsp.rs | |
parent | 40310eaebfaa38eff929213f2d6b912b87ad3edf (diff) |
fix(lsp): handle invalid config setting better (#11104)
Fixes #11100
Fixes #10808
Diffstat (limited to 'cli/tests/integration_tests_lsp.rs')
-rw-r--r-- | cli/tests/integration_tests_lsp.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cli/tests/integration_tests_lsp.rs b/cli/tests/integration_tests_lsp.rs index 04c66625c..c33f6721f 100644 --- a/cli/tests/integration_tests_lsp.rs +++ b/cli/tests/integration_tests_lsp.rs @@ -172,6 +172,30 @@ fn lsp_tsconfig_types() { } #[test] +fn lsp_tsconfig_bad_config_path() { + let mut client = init("initialize_params_bad_config_option.json"); + let (method, maybe_params) = client.read_notification().unwrap(); + assert_eq!(method, "window/showMessage"); + assert_eq!(maybe_params, Some(lsp::ShowMessageParams { + typ: lsp::MessageType::Warning, + message: "The path to the configuration file (\"bad_tsconfig.json\") is not resolvable.".to_string() + })); + let diagnostics = did_open( + &mut client, + json!({ + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "console.log(Deno.args);\n" + } + }), + ); + let diagnostics = diagnostics.into_iter().flat_map(|x| x.diagnostics); + assert_eq!(diagnostics.count(), 0); +} + +#[test] fn lsp_triple_slash_types() { let mut params: lsp::InitializeParams = serde_json::from_value(load_fixture("initialize_params.json")).unwrap(); |