Skip to content

Commit fe1eafc

Browse files
authored
Merge pull request microsoft#125498 from microsoft/hediet/fix-125034
Renames "Inline Completion" to "Inline Suggestion". Removes Ghost Text Expanded Setting (default true)
2 parents dcf62e3 + 5eb636f commit fe1eafc

File tree

9 files changed

+266
-233
lines changed

9 files changed

+266
-233
lines changed

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

Lines changed: 54 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ export interface IEditorOptions {
382382
* Suggest options.
383383
*/
384384
suggest?: ISuggestOptions;
385+
inlineSuggest?: IInlineSuggestOptions;
385386
/**
386387
* Smart select options.
387388
*/
@@ -3140,6 +3141,51 @@ class EditorScrollbar extends BaseEditorOption<EditorOption.scrollbar, InternalE
31403141

31413142
//#endregion
31423143

3144+
//#region inlineSuggest
3145+
3146+
export interface IInlineSuggestOptions {
3147+
/**
3148+
* Enable or disable the rendering of automatic inline completions.
3149+
*/
3150+
enabled?: boolean;
3151+
}
3152+
3153+
export type InternalInlineSuggestOptions = Readonly<Required<IInlineSuggestOptions>>;
3154+
3155+
/**
3156+
* Configuration options for inline suggestions
3157+
*/
3158+
class InlineEditorSuggest extends BaseEditorOption<EditorOption.inlineSuggest, InternalInlineSuggestOptions> {
3159+
constructor() {
3160+
const defaults: InternalInlineSuggestOptions = {
3161+
enabled: false
3162+
};
3163+
3164+
super(
3165+
EditorOption.inlineSuggest, 'inlineSuggest', defaults,
3166+
{
3167+
'editor.inlineSuggest.enabled': {
3168+
type: 'boolean',
3169+
default: defaults.enabled,
3170+
description: nls.localize('inlineSuggest.enabled', "Controls whether to automatically show inline suggestions in the editor.")
3171+
},
3172+
}
3173+
);
3174+
}
3175+
3176+
public validate(_input: any): InternalInlineSuggestOptions {
3177+
if (!_input || typeof _input !== 'object') {
3178+
return this.defaultValue;
3179+
}
3180+
const input = _input as IInlineSuggestOptions;
3181+
return {
3182+
enabled: boolean(input.enabled, this.defaultValue.enabled),
3183+
};
3184+
}
3185+
}
3186+
3187+
//#endregion
3188+
31433189
//#region suggest
31443190

31453191
/**
@@ -3177,16 +3223,7 @@ export interface ISuggestOptions {
31773223
/**
31783224
* Enable or disable the rendering of the suggestion preview.
31793225
*/
3180-
showSuggestionPreview?: boolean;
3181-
/**
3182-
* Enable or disable the rendering of automatic inline completions.
3183-
*/
3184-
showInlineCompletions?: boolean;
3185-
/**
3186-
* Enable or disable the default expansion of the ghost text as used
3187-
* by the suggestion preview or the inline completions.
3188-
*/
3189-
ghostTextExpanded?: boolean;
3226+
preview?: boolean;
31903227
/**
31913228
* Show details inline with the label. Defaults to true.
31923229
*/
@@ -3318,9 +3355,7 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, InternalSugge
33183355
shareSuggestSelections: false,
33193356
showIcons: true,
33203357
showStatusBar: false,
3321-
showSuggestionPreview: false,
3322-
ghostTextExpanded: true,
3323-
showInlineCompletions: false,
3358+
preview: false,
33243359
showInlineDetails: true,
33253360
showMethods: true,
33263361
showFunctions: true,
@@ -3394,20 +3429,10 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, InternalSugge
33943429
default: defaults.showStatusBar,
33953430
description: nls.localize('suggest.showStatusBar', "Controls the visibility of the status bar at the bottom of the suggest widget.")
33963431
},
3397-
'editor.suggest.showSuggestionPreview': {
3398-
type: 'boolean',
3399-
default: defaults.showSuggestionPreview,
3400-
description: nls.localize('suggest.showSuggestionPreview', "Controls whether to preview the suggestion outcome in the editor.")
3401-
},
3402-
'editor.suggest.showInlineCompletions': {
3403-
type: 'boolean',
3404-
default: defaults.showInlineCompletions,
3405-
description: nls.localize('suggest.showInlineCompletions', "Controls whether to show inline completions in the editor.")
3406-
},
3407-
'editor.suggest.ghostTextExpanded': {
3432+
'editor.suggest.preview': {
34083433
type: 'boolean',
3409-
default: defaults.ghostTextExpanded,
3410-
description: nls.localize('suggest.ghostTextExpanded', "Controls whether the ghost text that is used by the suggestion preview or the inline completions is expanted by default.")
3434+
default: defaults.preview,
3435+
description: nls.localize('suggest.preview', "Controls whether to preview the suggestion outcome in the editor.")
34113436
},
34123437
'editor.suggest.showInlineDetails': {
34133438
type: 'boolean',
@@ -3584,9 +3609,7 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, InternalSugge
35843609
shareSuggestSelections: boolean(input.shareSuggestSelections, this.defaultValue.shareSuggestSelections),
35853610
showIcons: boolean(input.showIcons, this.defaultValue.showIcons),
35863611
showStatusBar: boolean(input.showStatusBar, this.defaultValue.showStatusBar),
3587-
showSuggestionPreview: boolean(input.showSuggestionPreview, this.defaultValue.showSuggestionPreview),
3588-
ghostTextExpanded: boolean(input.ghostTextExpanded, this.defaultValue.ghostTextExpanded),
3589-
showInlineCompletions: boolean(input.showInlineCompletions, this.defaultValue.showInlineCompletions),
3612+
preview: boolean(input.preview, this.defaultValue.preview),
35903613
showInlineDetails: boolean(input.showInlineDetails, this.defaultValue.showInlineDetails),
35913614
showMethods: boolean(input.showMethods, this.defaultValue.showMethods),
35923615
showFunctions: boolean(input.showFunctions, this.defaultValue.showFunctions),
@@ -3834,6 +3857,7 @@ export const enum EditorOption {
38343857
highlightActiveIndentGuide,
38353858
hover,
38363859
inDiffEditor,
3860+
inlineSuggest,
38373861
letterSpacing,
38383862
lightbulb,
38393863
lineDecorationsWidth,
@@ -4452,6 +4476,7 @@ export const EditorOptions = {
44524476
10000, -1, Constants.MAX_SAFE_SMALL_INTEGER,
44534477
)),
44544478
suggest: register(new EditorSuggest()),
4479+
inlineSuggest: register(new InlineEditorSuggest()),
44554480
suggestFontSize: register(new EditorIntOption(
44564481
EditorOption.suggestFontSize, 'suggestFontSize',
44574482
0, 0, 1000,

src/vs/editor/common/standalone/standaloneEnums.ts

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -219,83 +219,84 @@ export enum EditorOption {
219219
highlightActiveIndentGuide = 49,
220220
hover = 50,
221221
inDiffEditor = 51,
222-
letterSpacing = 52,
223-
lightbulb = 53,
224-
lineDecorationsWidth = 54,
225-
lineHeight = 55,
226-
lineNumbers = 56,
227-
lineNumbersMinChars = 57,
228-
linkedEditing = 58,
229-
links = 59,
230-
matchBrackets = 60,
231-
minimap = 61,
232-
mouseStyle = 62,
233-
mouseWheelScrollSensitivity = 63,
234-
mouseWheelZoom = 64,
235-
multiCursorMergeOverlapping = 65,
236-
multiCursorModifier = 66,
237-
multiCursorPaste = 67,
238-
occurrencesHighlight = 68,
239-
overviewRulerBorder = 69,
240-
overviewRulerLanes = 70,
241-
padding = 71,
242-
parameterHints = 72,
243-
peekWidgetDefaultFocus = 73,
244-
definitionLinkOpensInPeek = 74,
245-
quickSuggestions = 75,
246-
quickSuggestionsDelay = 76,
247-
readOnly = 77,
248-
renameOnType = 78,
249-
renderControlCharacters = 79,
250-
renderIndentGuides = 80,
251-
renderFinalNewline = 81,
252-
renderLineHighlight = 82,
253-
renderLineHighlightOnlyWhenFocus = 83,
254-
renderValidationDecorations = 84,
255-
renderWhitespace = 85,
256-
revealHorizontalRightPadding = 86,
257-
roundedSelection = 87,
258-
rulers = 88,
259-
scrollbar = 89,
260-
scrollBeyondLastColumn = 90,
261-
scrollBeyondLastLine = 91,
262-
scrollPredominantAxis = 92,
263-
selectionClipboard = 93,
264-
selectionHighlight = 94,
265-
selectOnLineNumbers = 95,
266-
showFoldingControls = 96,
267-
showUnused = 97,
268-
snippetSuggestions = 98,
269-
smartSelect = 99,
270-
smoothScrolling = 100,
271-
stickyTabStops = 101,
272-
stopRenderingLineAfter = 102,
273-
suggest = 103,
274-
suggestFontSize = 104,
275-
suggestLineHeight = 105,
276-
suggestOnTriggerCharacters = 106,
277-
suggestSelection = 107,
278-
tabCompletion = 108,
279-
tabIndex = 109,
280-
unusualLineTerminators = 110,
281-
useShadowDOM = 111,
282-
useTabStops = 112,
283-
wordSeparators = 113,
284-
wordWrap = 114,
285-
wordWrapBreakAfterCharacters = 115,
286-
wordWrapBreakBeforeCharacters = 116,
287-
wordWrapColumn = 117,
288-
wordWrapOverride1 = 118,
289-
wordWrapOverride2 = 119,
290-
wrappingIndent = 120,
291-
wrappingStrategy = 121,
292-
showDeprecated = 122,
293-
inlayHints = 123,
294-
editorClassName = 124,
295-
pixelRatio = 125,
296-
tabFocusMode = 126,
297-
layoutInfo = 127,
298-
wrappingInfo = 128
222+
inlineSuggest = 52,
223+
letterSpacing = 53,
224+
lightbulb = 54,
225+
lineDecorationsWidth = 55,
226+
lineHeight = 56,
227+
lineNumbers = 57,
228+
lineNumbersMinChars = 58,
229+
linkedEditing = 59,
230+
links = 60,
231+
matchBrackets = 61,
232+
minimap = 62,
233+
mouseStyle = 63,
234+
mouseWheelScrollSensitivity = 64,
235+
mouseWheelZoom = 65,
236+
multiCursorMergeOverlapping = 66,
237+
multiCursorModifier = 67,
238+
multiCursorPaste = 68,
239+
occurrencesHighlight = 69,
240+
overviewRulerBorder = 70,
241+
overviewRulerLanes = 71,
242+
padding = 72,
243+
parameterHints = 73,
244+
peekWidgetDefaultFocus = 74,
245+
definitionLinkOpensInPeek = 75,
246+
quickSuggestions = 76,
247+
quickSuggestionsDelay = 77,
248+
readOnly = 78,
249+
renameOnType = 79,
250+
renderControlCharacters = 80,
251+
renderIndentGuides = 81,
252+
renderFinalNewline = 82,
253+
renderLineHighlight = 83,
254+
renderLineHighlightOnlyWhenFocus = 84,
255+
renderValidationDecorations = 85,
256+
renderWhitespace = 86,
257+
revealHorizontalRightPadding = 87,
258+
roundedSelection = 88,
259+
rulers = 89,
260+
scrollbar = 90,
261+
scrollBeyondLastColumn = 91,
262+
scrollBeyondLastLine = 92,
263+
scrollPredominantAxis = 93,
264+
selectionClipboard = 94,
265+
selectionHighlight = 95,
266+
selectOnLineNumbers = 96,
267+
showFoldingControls = 97,
268+
showUnused = 98,
269+
snippetSuggestions = 99,
270+
smartSelect = 100,
271+
smoothScrolling = 101,
272+
stickyTabStops = 102,
273+
stopRenderingLineAfter = 103,
274+
suggest = 104,
275+
suggestFontSize = 105,
276+
suggestLineHeight = 106,
277+
suggestOnTriggerCharacters = 107,
278+
suggestSelection = 108,
279+
tabCompletion = 109,
280+
tabIndex = 110,
281+
unusualLineTerminators = 111,
282+
useShadowDOM = 112,
283+
useTabStops = 113,
284+
wordSeparators = 114,
285+
wordWrap = 115,
286+
wordWrapBreakAfterCharacters = 116,
287+
wordWrapBreakBeforeCharacters = 117,
288+
wordWrapColumn = 118,
289+
wordWrapOverride1 = 119,
290+
wordWrapOverride2 = 120,
291+
wrappingIndent = 121,
292+
wrappingStrategy = 122,
293+
showDeprecated = 123,
294+
inlayHints = 124,
295+
editorClassName = 125,
296+
pixelRatio = 126,
297+
tabFocusMode = 127,
298+
layoutInfo = 128,
299+
wrappingInfo = 129
299300
}
300301

301302
/**

0 commit comments

Comments
 (0)