Change:
Issue Type: <bBug</b! VS Code version: Code - Insiders 1.50.0-insider (, 2020-09-12T00:56:22.923Z) OS version: Darwin x64 19.4.0 Remote OS version: Linux x64 4.19.76-linuxkit <details<summarySystem Info</summary </details<!-- generated by issue reporter --
This is the order that it's contributed in. Do you think that the settings UI should sort them alphabetically like they are in the suggest widget, or leave them in contribution order, in case that is important? Looking through some enum settings, some seem to order the options in an intentional way, like with the default first, or the simpler options first. Some are random or are sorted. I think I am inclined to display them in contributed order to keep this an option (and we can sort the encodings manually), but I'm not sure, what do you think?
It should be this order, same as the picker: ! The encodings are not sorted by name intentionally. But they are grouped by type and I guess that is not very visible in the settings editor.
Oh, got it. I've seen a few of these cases where it would make sense to display the enumDescription in the dropdown instead of the actual value. It doesn't make sense in general but it would be cool to provide an option for settings to opt into that, what do you think?
Yeah I think it would make a lot of sense in this case
I think we should add an option to the schema contribution for this but I have no clue what to call it
If the dropdown list will now display the enumDescriptions, should the description footer on the list show the value to be set? Should the collapsed dropdown control show the selected value or its enumDescription?
Yes, I'd say just swap them I think it should show the enumDescriptioni
I'll start working on this issue. Thanks for your help.
Now this will show with the key in the description area in square brackets. But it would look much nicer to match the editor encoding picker, so I opened for that.

Discussion:
included?: boolean; tags?: string[]; disallowSyncIgnore?: boolean; <ins> enumItemLabels?: string[]; </ins> } export interface IConfigurationExtensionInfo {

containerIcon: icon || viewContainer?.icon, containerTitle: item.contextualTitle || viewContainer?.name, canToggleVisibility: true, <del> canMoveView: true, </del> <ins> canMoveView: viewContainer?.id !== REMOTE, </ins> treeView: type === ViewType.Tree ? this.instantiationService.createInstance(CustomTreeView, item.id, item.name) : undefined, collapsed: this.showCollapsed(container) || initialVisibility === InitialVisibility.Collapsed, order: order,

'default': 'utf8', 'description': nls.localize('encoding', "The default character set encoding to use when reading and writing files. This setting can also be configured per language."), 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE, <del> 'enumDescriptions': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong) </del> <ins> 'enumDescriptions': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong), 'enumItemLabels': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong) </ins> }, 'files.autoGuessEncoding': { 'type': 'boolean',

} protected renderValue(dataElement: SettingsTreeSettingElement, template: ISettingEnumItemTemplate, onChange: (value: string) => void): void { <ins> const enumItemLabels = dataElement.setting.enumItemLabels; </ins> const enumDescriptions = dataElement.setting.enumDescriptions; const enumDescriptionsAreMarkdown = dataElement.setting.enumDescriptionsAreMarkdown;

const displayOptions = dataElement.setting.enum! .map(String) .map(escapeInvisibleChars) <del> .map((data, index) => <ISelectOptionItem>{ text: data, description: (enumDescriptions && enumDescriptions[index] && (enumDescriptionsAreMarkdown ? fixSettingLinks(enumDescriptions[index], false) : enumDescriptions[index])), descriptionIsMarkdown: enumDescriptionsAreMarkdown, descriptionMarkdownActionHandler: { callback: (content) => { this._openerService.open(content).catch(onUnexpectedError); </del> <ins> .map((data, index) => { const description = (enumDescriptions && enumDescriptions[index] && (enumDescriptionsAreMarkdown ? fixSettingLinks(enumDescriptions[index], false) : enumDescriptions[index])); return <ISelectOptionItem>{ text: enumItemLabels && enumItemLabels[index] ? enumItemLabels[index] : data, description: enumItemLabels && enumItemLabels[index] ? `[${data}] ${description}` : description, descriptionIsMarkdown: enumDescriptionsAreMarkdown, descriptionMarkdownActionHandler: { callback: (content) => { this._openerService.open(content).catch(onUnexpectedError); }, disposeables: disposables </ins> }, <del> disposeables: disposables }, decoratorRight: (data === dataElement.defaultValue ? localize('settings.Default', "default") : '') </del> <ins> decoratorRight: (data === dataElement.defaultValue ? localize('settings.Default', "default") : '') }; </ins> }); template.selectBox.setOptions(displayOptions);

disallowSyncIgnore?: boolean; extensionInfo?: IConfigurationExtensionInfo; validator?: (value: any) => string | null; <ins> enumItemLabels?: string[]; </ins> } export interface IExtensionSetting extends ISetting {

extensionInfo: extensionInfo, deprecationMessage: prop.markdownDeprecationMessage || prop.deprecationMessage, deprecationMessageIsMarkdown: !!prop.markdownDeprecationMessage, <del> validator: createValidator(prop) </del> <ins> validator: createValidator(prop), enumItemLabels: prop.enumItemLabels </ins> }); } }

if (otherHost) { return mapHasTunnel(map, otherHost, port); } <ins> return false; </ins> } return true; }