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

fix(lsp): refresh npm completions on each character (#20565)

This commit is contained in:
Nayeem Rahman 2023-09-19 13:01:06 +01:00 committed by GitHub
parent 2772d302f5
commit 9004117790
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,10 +167,11 @@ pub async fn get_import_completions(
items: get_local_completions(specifier, &text, &range)?,
}))
} else if text.starts_with("npm:") {
let items =
get_npm_completions(specifier, &text, &range, npm_search_api).await?;
Some(lsp::CompletionResponse::List(lsp::CompletionList {
is_incomplete: false,
items: get_npm_completions(specifier, &text, &range, npm_search_api)
.await?,
is_incomplete: !items.is_empty(),
items,
}))
} else if !text.is_empty() {
// completion of modules from a module registry or cache