提交 59681e54 编写于 作者: J Johannes Rieken

💄 rename setting to maxVisibileSuggestions, #68557

上级 bb750dac
...@@ -684,12 +684,12 @@ const editorConfiguration: IConfigurationNode = { ...@@ -684,12 +684,12 @@ const editorConfiguration: IConfigurationNode = {
default: EDITOR_DEFAULTS.contribInfo.suggest.showIcons, default: EDITOR_DEFAULTS.contribInfo.suggest.showIcons,
description: nls.localize('suggest.showIcons', "Controls whether to show or hide icons in suggestions.") description: nls.localize('suggest.showIcons', "Controls whether to show or hide icons in suggestions.")
}, },
'editor.suggest.maxSuggestionsToShow': { 'editor.suggest.maxVisibileSuggestions': {
type: 'number', type: 'number',
default: EDITOR_DEFAULTS.contribInfo.suggest.maxSuggestionsToShow, default: EDITOR_DEFAULTS.contribInfo.suggest.maxVisibileSuggestions,
minimum: 1, minimum: 1,
maximum: 12, maximum: 12,
description: nls.localize('suggest.maxSuggestionsToShow', "Controls how many suggestions to show in suggestions.") description: nls.localize('suggest.maxVisibileSuggestions', "Controls how many suggestions IntelliSense will show before showing a scrollbar.")
}, },
'editor.selectionHighlight': { 'editor.selectionHighlight': {
'type': 'boolean', 'type': 'boolean',
......
...@@ -926,7 +926,7 @@ export interface InternalSuggestOptions { ...@@ -926,7 +926,7 @@ export interface InternalSuggestOptions {
readonly localityBonus: boolean; readonly localityBonus: boolean;
readonly shareSuggestSelections: boolean; readonly shareSuggestSelections: boolean;
readonly showIcons: boolean; readonly showIcons: boolean;
readonly maxSuggestionsToShow: number; readonly maxVisibileSuggestions: number;
} }
export interface InternalParameterHintOptions { export interface InternalParameterHintOptions {
...@@ -1379,7 +1379,7 @@ export class InternalEditorOptions { ...@@ -1379,7 +1379,7 @@ export class InternalEditorOptions {
&& a.localityBonus === b.localityBonus && a.localityBonus === b.localityBonus
&& a.shareSuggestSelections === b.shareSuggestSelections && a.shareSuggestSelections === b.shareSuggestSelections
&& a.showIcons === b.showIcons && a.showIcons === b.showIcons
&& a.maxSuggestionsToShow === b.maxSuggestionsToShow; && a.maxVisibileSuggestions === b.maxVisibileSuggestions;
} }
} }
...@@ -1913,7 +1913,7 @@ export class EditorOptionsValidator { ...@@ -1913,7 +1913,7 @@ export class EditorOptionsValidator {
localityBonus: _boolean(suggestOpts.localityBonus, defaults.localityBonus), localityBonus: _boolean(suggestOpts.localityBonus, defaults.localityBonus),
shareSuggestSelections: _boolean(suggestOpts.shareSuggestSelections, defaults.shareSuggestSelections), shareSuggestSelections: _boolean(suggestOpts.shareSuggestSelections, defaults.shareSuggestSelections),
showIcons: _boolean(suggestOpts.showIcons, defaults.showIcons), showIcons: _boolean(suggestOpts.showIcons, defaults.showIcons),
maxSuggestionsToShow: _clampedInt(suggestOpts.maxSuggestionsToShow, defaults.maxSuggestionsToShow, 1, 12) maxVisibileSuggestions: _clampedInt(suggestOpts.maxSuggestionsToShow, defaults.maxVisibileSuggestions, 1, 12)
}; };
} }
...@@ -2672,7 +2672,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = { ...@@ -2672,7 +2672,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
localityBonus: false, localityBonus: false,
shareSuggestSelections: false, shareSuggestSelections: false,
showIcons: true, showIcons: true,
maxSuggestionsToShow: 12 maxVisibileSuggestions: 12
}, },
selectionHighlight: true, selectionHighlight: true,
occurrencesHighlight: true, occurrencesHighlight: true,
......
...@@ -1037,8 +1037,8 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl ...@@ -1037,8 +1037,8 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
height = this.unfocusedHeight; height = this.unfocusedHeight;
} else { } else {
const suggestionCount = this.list.contentHeight / this.unfocusedHeight; const suggestionCount = this.list.contentHeight / this.unfocusedHeight;
const maxSuggestionsToShow = this.editor.getConfiguration().contribInfo.suggest.maxSuggestionsToShow; const { maxVisibileSuggestions } = this.editor.getConfiguration().contribInfo.suggest;
height = Math.min(suggestionCount, maxSuggestionsToShow) * this.unfocusedHeight; height = Math.min(suggestionCount, maxVisibileSuggestions) * this.unfocusedHeight;
} }
this.element.style.lineHeight = `${this.unfocusedHeight}px`; this.element.style.lineHeight = `${this.unfocusedHeight}px`;
...@@ -1118,7 +1118,7 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl ...@@ -1118,7 +1118,7 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
// Heights // Heights
private get maxWidgetHeight(): number { private get maxWidgetHeight(): number {
return this.unfocusedHeight * this.editor.getConfiguration().contribInfo.suggest.maxSuggestionsToShow; return this.unfocusedHeight * this.editor.getConfiguration().contribInfo.suggest.maxVisibileSuggestions;
} }
private get unfocusedHeight(): number { private get unfocusedHeight(): number {
......
...@@ -164,7 +164,7 @@ suite('CompletionModel', function () { ...@@ -164,7 +164,7 @@ suite('CompletionModel', function () {
localityBonus: false, localityBonus: false,
shareSuggestSelections: false, shareSuggestSelections: false,
showIcons: true, showIcons: true,
maxSuggestionsToShow: 12 maxVisibileSuggestions: 12
}); });
assert.equal(model.items.length, 2); assert.equal(model.items.length, 2);
...@@ -191,7 +191,7 @@ suite('CompletionModel', function () { ...@@ -191,7 +191,7 @@ suite('CompletionModel', function () {
localityBonus: false, localityBonus: false,
shareSuggestSelections: false, shareSuggestSelections: false,
showIcons: true, showIcons: true,
maxSuggestionsToShow: 12 maxVisibileSuggestions: 12
}); });
assert.equal(model.items.length, 2); assert.equal(model.items.length, 2);
...@@ -217,7 +217,7 @@ suite('CompletionModel', function () { ...@@ -217,7 +217,7 @@ suite('CompletionModel', function () {
localityBonus: false, localityBonus: false,
shareSuggestSelections: false, shareSuggestSelections: false,
showIcons: true, showIcons: true,
maxSuggestionsToShow: 12 maxVisibileSuggestions: 12
}); });
assert.equal(model.items.length, 2); assert.equal(model.items.length, 2);
......
...@@ -3199,7 +3199,7 @@ declare namespace monaco.editor { ...@@ -3199,7 +3199,7 @@ declare namespace monaco.editor {
readonly localityBonus: boolean; readonly localityBonus: boolean;
readonly shareSuggestSelections: boolean; readonly shareSuggestSelections: boolean;
readonly showIcons: boolean; readonly showIcons: boolean;
readonly maxSuggestionsToShow: number; readonly maxVisibileSuggestions: number;
} }
export interface InternalParameterHintOptions { export interface InternalParameterHintOptions {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册