summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2024-05-16 22:12:25 +0100
committerGitHub <noreply@github.com>2024-05-16 22:12:25 +0100
commitf8956eb763159f325d5cb0d4c4281d2e640e2e71 (patch)
tree740ee2ddd33a48c96be30ddf04e99265606d073d /tests
parent7893ab9f0bb406081723ce80829d3ad6303da162 (diff)
fix(lsp): respect types dependencies for tsc roots (#23825)
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/lsp_tests.rs28
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();