Skip to content

Commit d9fc8d3

Browse files
authored
Change suppressInlineSuggestions to be a string (and thus exp controllable) (#252351)
1 parent 0cc4cb0 commit d9fc8d3

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

src/vs/editor/common/config/editorOptions.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,13 +1369,6 @@ class EditorEnumOption<K extends EditorOption, T extends string, V> extends Base
13691369
}
13701370
}
13711371

1372-
function stringArray(value: any, defaultValue: string[]): string[] {
1373-
if (!Array.isArray(value)) {
1374-
return defaultValue;
1375-
}
1376-
return value.map(item => String(item));
1377-
}
1378-
13791372
//#endregion
13801373

13811374
//#region autoIndent
@@ -4308,7 +4301,7 @@ export interface IInlineSuggestOptions {
43084301
/**
43094302
* @internal
43104303
*/
4311-
suppressInlineSuggestions?: string[];
4304+
suppressInlineSuggestions?: string;
43124305
};
43134306
}
43144307

@@ -4341,7 +4334,7 @@ class InlineEditorSuggest extends BaseEditorOption<EditorOption.inlineSuggest, I
43414334
allowCodeShifting: 'always',
43424335
},
43434336
experimental: {
4344-
suppressInlineSuggestions: [],
4337+
suppressInlineSuggestions: '',
43454338
},
43464339
};
43474340

@@ -4375,10 +4368,10 @@ class InlineEditorSuggest extends BaseEditorOption<EditorOption.inlineSuggest, I
43754368
description: nls.localize('inlineSuggest.suppressSuggestions', "Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")
43764369
},
43774370
'editor.inlineSuggest.experimental.suppressInlineSuggestions': {
4378-
type: 'array',
4371+
type: 'string',
4372+
default: defaults.experimental.suppressInlineSuggestions,
43794373
tags: ['experimental', 'onExp'],
4380-
items: { type: 'string' },
4381-
description: nls.localize('inlineSuggest.suppressInlineSuggestions', "Suppresses inline completions for specified extension IDs.")
4374+
description: nls.localize('inlineSuggest.suppressInlineSuggestions', "Suppresses inline completions for specified extension IDs -- comma separated.")
43824375
},
43834376
'editor.inlineSuggest.fontFamily': {
43844377
type: 'string',
@@ -4433,7 +4426,7 @@ class InlineEditorSuggest extends BaseEditorOption<EditorOption.inlineSuggest, I
44334426
renderSideBySide: stringSet(input.edits?.renderSideBySide, this.defaultValue.edits.renderSideBySide, ['never', 'auto']),
44344427
},
44354428
experimental: {
4436-
suppressInlineSuggestions: stringArray(input.experimental?.suppressInlineSuggestions, this.defaultValue.experimental.suppressInlineSuggestions),
4429+
suppressInlineSuggestions: EditorStringOption.string(input.experimental?.suppressInlineSuggestions, this.defaultValue.experimental.suppressInlineSuggestions),
44374430
},
44384431
};
44394432
}

src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class InlineCompletionsModel extends Disposable {
107107
this._suggestPreviewEnabled = this._editorObs.getOption(EditorOption.suggest).map(v => v.preview);
108108
this._suggestPreviewMode = this._editorObs.getOption(EditorOption.suggest).map(v => v.previewMode);
109109
this._inlineSuggestMode = this._editorObs.getOption(EditorOption.inlineSuggest).map(v => v.mode);
110-
this._suppressedInlineCompletionGroupIds = this._editorObs.getOption(EditorOption.inlineSuggest).map(v => new Set(v.experimental.suppressInlineSuggestions));
110+
this._suppressedInlineCompletionGroupIds = this._editorObs.getOption(EditorOption.inlineSuggest).map(v => new Set(v.experimental.suppressInlineSuggestions.split(',')));
111111
this._inlineEditsEnabled = this._editorObs.getOption(EditorOption.inlineSuggest).map(v => !!v.edits.enabled);
112112
this._inlineEditsShowCollapsedEnabled = this._editorObs.getOption(EditorOption.inlineSuggest).map(s => s.edits.showCollapsed);
113113
this._lastShownInlineCompletionInfo = undefined;

0 commit comments

Comments
 (0)