summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2024-10-31 10:52:43 +0000
committerGitHub <noreply@github.com>2024-10-31 10:52:43 +0000
commit2f0c25d33fc0c8bb8e6e92826b2549f429d68d42 (patch)
treea80efeb107d3720a5f1ae528955f76549cb913b4 /tests/integration
parent8bfd134da6d730cc1d182ab430b1713901d7a5b5 (diff)
fix(lsp): include unstable features from editor settings (#26655)
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/lsp_tests.rs30
1 files changed, 14 insertions, 16 deletions
diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs
index 79e6dc5c4..2376aebd9 100644
--- a/tests/integration/lsp_tests.rs
+++ b/tests/integration/lsp_tests.rs
@@ -15484,25 +15484,23 @@ fn lsp_sloppy_imports() {
fn lsp_sloppy_imports_prefers_dts() {
let context = TestContextBuilder::new().use_temp_cwd().build();
let temp_dir = context.temp_dir();
- let temp_dir = temp_dir.path();
-
- temp_dir
- .join("deno.json")
- .write(r#"{ "unstable": ["sloppy-imports"] }"#);
-
- let mut client: LspClient = context
- .new_lsp_command()
- .set_root_dir(temp_dir.clone())
- .build();
- client.initialize_default();
-
- temp_dir.join("a.js").write("export const foo: number;");
-
- let a_dts = source_file(temp_dir.join("a.d.ts"), "export const foo = 3;");
+ temp_dir.write("deno.json", json!({}).to_string());
+ temp_dir.write("a.js", "export const foo: number;");
+ let a_dts =
+ source_file(temp_dir.path().join("a.d.ts"), "export const foo = 3;");
let file = source_file(
- temp_dir.join("file.ts"),
+ temp_dir.path().join("file.ts"),
"import { foo } from './a.js';\nconsole.log(foo);",
);
+ let mut client: LspClient = context.new_lsp_command().build();
+ client.initialize_default();
+ client.change_configuration(json!({
+ "deno": {
+ "enable": true,
+ "unstable": ["sloppy-imports"],
+ },
+ }));
+
let diagnostics = client.did_open_file(&file);
// no other warnings because "a.js" exists
assert_eq!(