Skip to content

Commit

Permalink
fix(typescript): empty items list should be valid completion result
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed May 13, 2024
1 parent 8aa41e4 commit e5af37a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/typescript/lib/node/decorateLanguageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ export function decorateLanguageService(language: Language, languageService: ts.
continue;
}
const result = getCompletionsAtPosition(fileName, generatedOffset, options, formattingSettings);
if (!result || !result.entries.length) {
if (!result) {
continue;
}
if (typeof mapping.data.completion === 'object' && mapping.data.completion.onlyImport) {
Expand All @@ -715,7 +715,7 @@ export function decorateLanguageService(language: Language, languageService: ts.
results.push(result);
}
else {
results.splice(0, 0, result);
results.unshift(result);
}
}
if (results.length) {
Expand Down

0 comments on commit e5af37a

Please sign in to comment.