diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index a09f7169d9..0c193040bb 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -1332,6 +1332,8 @@ fn diagnose_resolution( None => diagnostics.push(DenoDiagnostic::NoAttributeType), } } + } else if specifier.scheme() == "jsr" { + // TODO(nayeemrmn): Check if jsr specifiers are cached. } else if let Ok(pkg_ref) = NpmPackageReqReference::from_specifier(specifier) { diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 3de8802fa5..c9abae2419 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();