Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inlineSuggest.showToolbar.never #198227

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/vs/editor/common/config/editorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3970,7 +3970,7 @@ export interface IInlineSuggestOptions {
*/
mode?: 'prefix' | 'subword' | 'subwordSmart';

showToolbar?: 'always' | 'onHover';
showToolbar?: 'always' | 'onHover' | 'never';

suppressSuggestions?: boolean;

Expand Down Expand Up @@ -4009,10 +4009,11 @@ class InlineEditorSuggest extends BaseEditorOption<EditorOption.inlineSuggest, I
'editor.inlineSuggest.showToolbar': {
type: 'string',
default: defaults.showToolbar,
enum: ['always', 'onHover'],
enum: ['always', 'onHover', 'never'],
enumDescriptions: [
nls.localize('inlineSuggest.showToolbar.always', "Show the inline suggestion toolbar whenever an inline suggestion is shown."),
nls.localize('inlineSuggest.showToolbar.onHover', "Show the inline suggestion toolbar when hovering over an inline suggestion."),
nls.localize('inlineSuggest.showToolbar.never', "Never show the inline suggestion toolbar."),
],
description: nls.localize('inlineSuggest.showToolbar', "Controls when to show the inline suggestion toolbar."),
},
Expand All @@ -4033,7 +4034,7 @@ class InlineEditorSuggest extends BaseEditorOption<EditorOption.inlineSuggest, I
return {
enabled: boolean(input.enabled, this.defaultValue.enabled),
mode: stringSet(input.mode, this.defaultValue.mode, ['prefix', 'subword', 'subwordSmart']),
showToolbar: stringSet(input.showToolbar, this.defaultValue.showToolbar, ['always', 'onHover']),
showToolbar: stringSet(input.showToolbar, this.defaultValue.showToolbar, ['always', 'onHover', 'never']),
suppressSuggestions: boolean(input.suppressSuggestions, this.defaultValue.suppressSuggestions),
keepOnBlur: boolean(input.keepOnBlur, this.defaultValue.keepOnBlur),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class InlineCompletionsHoverParticipant implements IEditorHoverParticipan
}

computeSync(anchor: HoverAnchor, lineDecorations: IModelDecoration[]): InlineCompletionsHover[] {
if (this._editor.getOption(EditorOption.inlineSuggest).showToolbar === 'always') {
if (this._editor.getOption(EditorOption.inlineSuggest).showToolbar !== 'onHover') {
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4439,7 +4439,7 @@ declare namespace monaco.editor {
* Defaults to `prefix`.
*/
mode?: 'prefix' | 'subword' | 'subwordSmart';
showToolbar?: 'always' | 'onHover';
showToolbar?: 'always' | 'onHover' | 'never';
suppressSuggestions?: boolean;
/**
* Does not clear active inline suggestions when the editor loses focus.
Expand Down