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

fix files.eol preferences cannot display correctly #11079

Merged
merged 1 commit into from
Apr 28, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { Preference } from '../../util/preference-types';
import { PreferenceLeafNodeRendererContribution } from './preference-node-renderer-creator';
import * as React from '@theia/core/shared/react';
import * as ReactDOM from '@theia/core/shared/react-dom';
import { escapeInvisibleChars } from '@theia/core/lib/common/strings';

@injectable()
export class PreferenceSelectInputRenderer extends PreferenceLeafNodeRenderer<JSONValue, HTMLDivElement> {
Expand All @@ -38,7 +39,9 @@ export class PreferenceSelectInputRenderer extends PreferenceLeafNodeRenderer<JS
const values = this.enumValues;
const defaultValue = this.preferenceNode.preference.data.default;
for (let i = 0; i < values.length; i++) {
const value = `${values[i]}`;
const value = values[i];
const stringValue = `${value}`;
const label = escapeInvisibleChars(stringValue);
const detail = PreferenceProvider.deepEqual(defaultValue, value) ? 'default' : undefined;
let enumDescription = this.preferenceNode.preference.data.enumDescriptions?.[i];
let markdown = false;
Expand All @@ -48,7 +51,8 @@ export class PreferenceSelectInputRenderer extends PreferenceLeafNodeRenderer<JS
markdown = true;
}
items.push({
value,
label,
value: stringValue,
detail,
description: enumDescription,
markdown
Expand Down