From 327b5b280b3914fffb5dc89019e4adfefa2b9eb5 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 6 Feb 2024 14:56:26 +0000 Subject: fix(lsp): disable no-cache diagnostics for jsr specifiers (#22284) --- cli/tests/integration/lsp_tests.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'cli/tests/integration/lsp_tests.rs') diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 3de8802fa..c9abae241 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -4657,6 +4657,29 @@ fn lsp_code_actions_deno_cache() { client.shutdown(); } +#[test] +fn lsp_jsr_uncached() { + let context = TestContextBuilder::new() + .use_http_server() + .use_temp_cwd() + .build(); + let temp_dir = context.temp_dir(); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + let diagnostics = client.did_open(json!({ + "textDocument": { + "uri": temp_dir.uri().join("file.ts").unwrap(), + "languageId": "typescript", + "version": 1, + "text": r#"import "jsr:@foo/bar";"#, + }, + })); + // TODO(nayeemrmn): This should check if the jsr dep is cached and give a + // diagnostic. + assert_eq!(json!(diagnostics.all()), json!([])); + client.shutdown(); +} + #[test] fn lsp_code_actions_deno_cache_npm() { let context = TestContextBuilder::new().use_temp_cwd().build(); -- cgit v1.2.3