Skip to content

Commit 9004117

Browse files
authored
fix(lsp): refresh npm completions on each character (#20565)
1 parent 2772d30 commit 9004117

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cli/lsp/completions.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,11 @@ pub async fn get_import_completions(
167167
items: get_local_completions(specifier, &text, &range)?,
168168
}))
169169
} else if text.starts_with("npm:") {
170+
let items =
171+
get_npm_completions(specifier, &text, &range, npm_search_api).await?;
170172
Some(lsp::CompletionResponse::List(lsp::CompletionList {
171-
is_incomplete: false,
172-
items: get_npm_completions(specifier, &text, &range, npm_search_api)
173-
.await?,
173+
is_incomplete: !items.is_empty(),
174+
items,
174175
}))
175176
} else if !text.is_empty() {
176177
// completion of modules from a module registry or cache

0 commit comments

Comments
 (0)