1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-11 00:21:05 -05:00

fix(lsp): complete exports for import mapped jsr specifiers (#24054)

This commit is contained in:
Nayeem Rahman 2024-06-03 21:32:28 +01:00 committed by GitHub
parent 13924fdb1b
commit 72088f2f52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 557 additions and 477 deletions

File diff suppressed because it is too large Load diff

View file

@ -2105,6 +2105,7 @@ impl Inner {
&self.jsr_search_api,
&self.npm_search_api,
&self.documents,
self.resolver.as_ref(),
self.config.tree.root_import_map().map(|i| i.as_ref()),
)
.await;

View file

@ -1224,6 +1224,7 @@ fn lsp_import_map_import_completions() {
r#"{
"imports": {
"/~/": "./lib/",
"/#/": "./src/",
"fs": "https://example.com/fs/index.js",
"std/": "https://example.com/std@0.123.0/"
}
@ -1296,7 +1297,14 @@ fn lsp_import_map_import_completions() {
"sortText": "/~",
"insertText": "/~",
"commitCharacters": ["\"", "'"],
}
}, {
"label": "/#",
"kind": 19,
"detail": "(import map)",
"sortText": "/#",
"insertText": "/#",
"commitCharacters": ["\"", "'"],
},
]
})
);
@ -1335,8 +1343,8 @@ fn lsp_import_map_import_completions() {
"items": [
{
"label": "b.ts",
"kind": 9,
"detail": "(import map)",
"kind": 17,
"detail": "(local)",
"sortText": "1",
"filterText": "/~/b.ts",
"textEdit": {
@ -7938,7 +7946,6 @@ fn lsp_completions_snippet() {
(5, 13),
json!({ "triggerKind": 1 }),
);
assert!(!list.is_incomplete);
assert_eq!(
json!(list),
json!({