diff options
author | Raymond Zhao <7199958+rzhao271@users.noreply.github.com> | 2022-06-08 04:01:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 04:01:04 +0300 |
commit | 907cc3e3d81524d667e9acae3ab20cc36cc74f46 (patch) | |
tree | 8a0b14d884ff403651e95f2fa85fa1a2728f6a21 /src/vs | |
parent | 60a68d666d7a3d39b614ecf3442bb12796bdaebd (diff) |
Simplify default override indicator impl (#151461)
Fixes #151164
Diffstat (limited to 'src/vs')
-rw-r--r-- | src/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.ts index 7f5d1e698ed..aac1b348f1c 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.ts @@ -125,13 +125,15 @@ export class SettingsTreeIndicatorsLabel { const defaultValueSource = element.defaultValueSource; if (defaultValueSource) { this.defaultOverrideIndicatorElement.style.display = 'inline'; + let sourceToDisplay = ''; if (typeof defaultValueSource !== 'string' && defaultValueSource.id !== element.setting.extensionInfo?.id) { - const extensionSource = defaultValueSource.displayName ?? defaultValueSource.id; - this.defaultOverrideIndicatorLabel.title = localize('defaultOverriddenDetails', "Default setting value overridden by {0}", extensionSource); - this.defaultOverrideIndicatorLabel.text = localize('defaultOverrideLabelText', "$(replace) {0}", extensionSource); + sourceToDisplay = defaultValueSource.displayName ?? defaultValueSource.id; } else if (typeof defaultValueSource === 'string') { - this.defaultOverrideIndicatorLabel.title = localize('defaultOverriddenDetails', "Default setting value overridden by {0}", defaultValueSource); - this.defaultOverrideIndicatorLabel.text = localize('defaultOverrideLabelText', "$(replace) {0}", defaultValueSource); + sourceToDisplay = defaultValueSource; + } + if (sourceToDisplay) { + this.defaultOverrideIndicatorLabel.title = localize('defaultOverriddenDetails', "Default setting value overridden by {0}", sourceToDisplay); + this.defaultOverrideIndicatorLabel.text = `$(replace) ${sourceToDisplay}`; } } this.render(); |