diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-08-20 19:38:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-20 19:38:47 +0100 |
commit | acba2cd48c3b8725c93513edc291a107bdc7eeaf (patch) | |
tree | 419bc06d81882506fa323558adac3ae7ff5327a0 /tests | |
parent | a7c8bb1596411f91e20ddd5cd54c9dbd055d1059 (diff) |
fix(lsp): include scoped import map keys in completions (#25047)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/lsp_tests.rs | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 3d20efbba..cacd05d9f 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -1346,23 +1346,27 @@ fn lsp_import_map_import_completions() { let context = TestContextBuilder::new().use_temp_cwd().build(); let temp_dir = context.temp_dir(); temp_dir.write( - "import-map.json", - r#"{ - "imports": { - "/~/": "./lib/", - "/#/": "./src/", - "fs": "https://example.com/fs/index.js", - "std/": "https://example.com/std@0.123.0/" - } -}"#, + "deno.json", + json!({ + "imports": { + "/~/": "./lib/", + "/#/": "./src/", + "fs": "https://example.com/fs/index.js", + "std/": "https://example.com/std@0.123.0/", + }, + "scopes": { + "file:///": { + "file": "./file.ts", + }, + }, + }) + .to_string(), ); temp_dir.create_dir_all("lib"); temp_dir.write("lib/b.ts", r#"export const b = "b";"#); let mut client = context.new_lsp_command().build(); - client.initialize(|builder| { - builder.set_import_map("import-map.json"); - }); + client.initialize_default(); let uri = temp_dir.uri().join("a.ts").unwrap(); @@ -1403,6 +1407,13 @@ fn lsp_import_map_import_completions() { "insertText": "..", "commitCharacters": ["\"", "'"], }, { + "label": "file", + "kind": 17, + "detail": "(import map)", + "sortText": "file", + "insertText": "file", + "commitCharacters": ["\"", "'"], + }, { "label": "std", "kind": 19, "detail": "(import map)", |