Skip to content

Commit 849154e

Browse files
committed
Fix type errors in suggest.ts
1 parent efb6885 commit 849154e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/vs/editor/contrib/suggest/browser/suggest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ export class CompletionOptions {
178178
) { }
179179
}
180180

181-
let _snippetSuggestSupport: languages.CompletionItemProvider;
181+
let _snippetSuggestSupport: languages.CompletionItemProvider | undefined;
182182

183-
export function getSnippetSuggestSupport(): languages.CompletionItemProvider {
183+
export function getSnippetSuggestSupport(): languages.CompletionItemProvider | undefined {
184184
return _snippetSuggestSupport;
185185
}
186186

187-
export function setSnippetSuggestSupport(support: languages.CompletionItemProvider): languages.CompletionItemProvider {
187+
export function setSnippetSuggestSupport(support: languages.CompletionItemProvider | undefined): languages.CompletionItemProvider | undefined {
188188
const old = _snippetSuggestSupport;
189189
_snippetSuggestSupport = support;
190190
return old;

src/vs/editor/contrib/suggest/browser/suggestModel.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ export class SuggestModel implements IDisposable {
230230
let set = supportsByTriggerCharacter.get(ch);
231231
if (!set) {
232232
set = new Set();
233-
set.add(getSnippetSuggestSupport());
233+
const suggestSupport = getSnippetSuggestSupport();
234+
if (suggestSupport) {
235+
set.add(suggestSupport);
236+
}
234237
supportsByTriggerCharacter.set(ch, set);
235238
}
236239
set.add(support);

0 commit comments

Comments
 (0)