summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2024-11-04 20:01:31 +0000
committerGitHub <noreply@github.com>2024-11-04 20:01:31 +0000
commitd67765b0b48d711cd0878e168ccb1e28178c4006 (patch)
tree9e1bbbfdecb48d31c45a3caaecbf8de278f118ee /tests/integration
parentd55e30f41855d40b36019f347a15b6c8984eb3e9 (diff)
fix(lsp): scope attribution for lazily loaded assets (#26699)
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/lsp_tests.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs
index 2376aebd9..56221a026 100644
--- a/tests/integration/lsp_tests.rs
+++ b/tests/integration/lsp_tests.rs
@@ -6396,6 +6396,45 @@ fn lsp_cache_on_save() {
client.shutdown();
}
+// Regression test for https://github.com/denoland/deno/issues/25999.
+#[test]
+fn lsp_asset_document_dom_code_action() {
+ let context = TestContextBuilder::new().use_temp_cwd().build();
+ let temp_dir = context.temp_dir();
+ temp_dir.write(
+ "deno.json",
+ json!({
+ "compilerOptions": {
+ "lib": ["deno.window", "dom"],
+ },
+ })
+ .to_string(),
+ );
+ let mut client = context.new_lsp_command().build();
+ client.initialize_default();
+ client.did_open(json!({
+ "textDocument": {
+ "uri": temp_dir.url().join("file.ts").unwrap(),
+ "languageId": "typescript",
+ "version": 1,
+ "text": r#""#,
+ },
+ }));
+ let res = client.write_request(
+ "textDocument/codeAction",
+ json!({
+ "textDocument": { "uri": "asset:///lib.dom.d.ts" },
+ "range": {
+ "start": { "line": 0, "character": 0 },
+ "end": { "line": 0, "character": 0 },
+ },
+ "context": { "diagnostics": [], "only": ["quickfix"] },
+ }),
+ );
+ assert_eq!(res, json!(null));
+ client.shutdown();
+}
+
// Regression test for https://github.com/denoland/deno/issues/22122.
#[test]
fn lsp_cache_then_definition() {