提交 0424ae8f 编写于 作者: J Joao Moreno

Merge remote-tracking branch 'origin/master'

...@@ -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,
......
...@@ -106,13 +106,15 @@ export function getDocumentFormattingEdits( ...@@ -106,13 +106,15 @@ export function getDocumentFormattingEdits(
"formatterInfo" : { "formatterInfo" : {
"type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"language" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "language" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"count" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } "count" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"extensions" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
} }
*/ */
telemetryService.publicLog('formatterInfo', { telemetryService.publicLog('formatterInfo', {
type: 'document', type: 'document',
language: model.getLanguageIdentifier().language, language: model.getLanguageIdentifier().language,
count: docFormattingProviders.length, count: docFormattingProviders.length,
extensions: docFormattingProviders.map(p => p.extensionId ? ExtensionIdentifier.toKey(p.extensionId) : 'unknown')
}); });
if (docFormattingProviders.length > 0) { if (docFormattingProviders.length > 0) {
...@@ -144,13 +146,15 @@ export function getOnTypeFormattingEdits( ...@@ -144,13 +146,15 @@ export function getOnTypeFormattingEdits(
"formatterInfo" : { "formatterInfo" : {
"type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"language" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "language" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"count" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } "count" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"extensions" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
} }
*/ */
telemetryService.publicLog('formatterInfo', { telemetryService.publicLog('formatterInfo', {
type: 'ontype', type: 'ontype',
language: model.getLanguageIdentifier().language, language: model.getLanguageIdentifier().language,
count: providers.length, count: providers.length,
extensions: providers.map(p => p.extensionId ? ExtensionIdentifier.toKey(p.extensionId) : 'unknown')
}); });
if (providers.length === 0) { if (providers.length === 0) {
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册