diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/lsp_tests.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 2d5bb2e24..1f7758a9d 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -8955,6 +8955,34 @@ fn lsp_diagnostics_deno_types() { } #[test] +fn lsp_root_with_global_reference_types() { + let context = TestContextBuilder::new() + .use_http_server() + .use_temp_cwd() + .build(); + let temp_dir = context.temp_dir(); + let file = source_file( + temp_dir.path().join("file.ts"), + "import 'http://localhost:4545/subdir/foo_types.d.ts'; Foo.bar;", + ); + let file2 = source_file( + temp_dir.path().join("file2.ts"), + r#"/// <reference types="http://localhost:4545/subdir/foo_types.d.ts" />"#, + ); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + client.write_request( + "workspace/executeCommand", + json!({ + "command": "deno.cache", + "arguments": [[], file2.uri()], + }), + ); + let diagnostics = client.did_open_file(&file); + assert_eq!(json!(diagnostics.all()), json!([])); +} + +#[test] fn lsp_diagnostics_refresh_dependents() { let context = TestContextBuilder::new().use_temp_cwd().build(); let mut client = context.new_lsp_command().build(); |