Skip to content

Commit 5c9ff75

Browse files
committed
fix(locality-bonus): plugins completions don't display when TS returned no completions
1 parent fd1cec6 commit 5c9ff75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

typescript/src/completionsAtPosition.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ export const getCompletionsAtPosition = (
9191
}
9292
}
9393
let prior = getPrior()
94+
// todo rethink its usage and maybe always prefill instead
9495
const ensurePrior = () => {
95-
if (!prior) prior = { entries: [], isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false }
96+
if (!prior) {
97+
prior = { entries: [], isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false }
98+
;(sharedCompletionContext.prior as typeof prior) = prior
99+
}
96100
return true
97101
}
98102
const hasSuggestions = prior?.entries.some(({ kind }) => kind !== ts.ScriptElementKind.warning)

0 commit comments

Comments
 (0)