未验证 提交 2a82df94 编写于 作者: L Logan Ramos

Part of #125422

上级 966eaaee
......@@ -47,7 +47,7 @@ export class UntitledTextEditorHintContribution implements IEditorContribution {
private update(): void {
this.untitledTextHintContentWidget?.dispose();
const configValue = this.configurationService.getValue<'text' | 'hidden'>(untitledTextEditorHintSetting);
const configValue = this.configurationService.getValue(untitledTextEditorHintSetting);
const model = this.editor.getModel();
if (model && model.uri.scheme === Schemas.untitled && model.getModeId() === PLAINTEXT_MODE_ID && configValue === 'text') {
......
......@@ -177,7 +177,7 @@ class NotebookOutlineRenderer implements ITreeRenderer<OutlineEntry, FuzzyScore,
template.container.style.removeProperty('--outline-element-color');
template.decoration.innerText = '';
if (markerInfo) {
const useBadges = this._configurationService.getValue<boolean>(OutlineConfigKeys.problemsBadges);
const useBadges = this._configurationService.getValue(OutlineConfigKeys.problemsBadges);
if (!useBadges) {
template.decoration.classList.remove('bubble');
template.decoration.innerText = '';
......@@ -189,7 +189,7 @@ class NotebookOutlineRenderer implements ITreeRenderer<OutlineEntry, FuzzyScore,
template.decoration.innerText = markerInfo.count > 9 ? '9+' : String(markerInfo.count);
}
const color = this._themeService.getColorTheme().getColor(markerInfo.topSev === MarkerSeverity.Error ? listErrorForeground : listWarningForeground);
const useColors = this._configurationService.getValue<boolean>(OutlineConfigKeys.problemsColors);
const useColors = this._configurationService.getValue(OutlineConfigKeys.problemsColors);
if (!useColors) {
template.container.style.removeProperty('--outline-element-color');
template.decoration.style.setProperty('--outline-element-color', color?.toString() ?? 'inherit');
......
......@@ -230,12 +230,12 @@ class ToggleRenderAction extends Action2 {
const configurationService = accessor.get(IConfigurationService);
if (this.toggleOutputs !== undefined) {
const oldValue = configurationService.getValue<boolean>('notebook.diff.ignoreOutputs');
const oldValue = configurationService.getValue('notebook.diff.ignoreOutputs');
configurationService.updateValue('notebook.diff.ignoreOutputs', !oldValue);
}
if (this.toggleMetadata !== undefined) {
const oldValue = configurationService.getValue<boolean>('notebook.diff.ignoreMetadata');
const oldValue = configurationService.getValue('notebook.diff.ignoreMetadata');
configurationService.updateValue('notebook.diff.ignoreMetadata', !oldValue);
}
}
......
......@@ -1274,7 +1274,7 @@ class AcceptChangesContribution extends Disposable implements IEditorContributio
}
if (syncResourceConflicts[1].some(({ remoteResource }) => isEqual(remoteResource, model.uri))) {
return this.configurationService.getValue<boolean>('diffEditor.renderSideBySide');
return this.configurationService.getValue('diffEditor.renderSideBySide');
}
return false;
......
......@@ -111,7 +111,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
}
private _isLocalWebWorkerEnabled() {
if (this._configurationService.getValue<boolean>(webWorkerExtHostConfig)) {
if (this._configurationService.getValue(webWorkerExtHostConfig)) {
return true;
}
if (this._environmentService.isExtensionDevelopment && this._environmentService.extensionDevelopmentKind?.some(k => k === 'web')) {
......
......@@ -138,7 +138,7 @@ export class BrowserHostService extends Disposable implements IHostService {
// Unknown / Keyboard shows veto depending on setting
case HostShutdownReason.Unknown:
case HostShutdownReason.Keyboard:
const confirmBeforeClose = this.configurationService.getValue<'always' | 'keyboardOnly' | 'never'>('window.confirmBeforeClose');
const confirmBeforeClose = this.configurationService.getValue('window.confirmBeforeClose');
if (confirmBeforeClose === 'always' || (confirmBeforeClose === 'keyboardOnly' && this.shutdownReason === HostShutdownReason.Keyboard)) {
e.veto(true, 'veto.confirmBeforeClose');
}
......
......@@ -30,8 +30,8 @@ export class TextResourcePropertiesService implements ITextResourcePropertiesSer
}
getEOL(resource?: URI, language?: string): string {
const eol = this.configurationService.getValue<string>('files.eol', { overrideIdentifier: language, resource });
if (eol && eol !== 'auto') {
const eol = this.configurationService.getValue('files.eol', { overrideIdentifier: language, resource });
if (eol && typeof eol === 'string' && eol !== 'auto') {
return eol;
}
const os = this.getOS(resource);
......
......@@ -380,10 +380,10 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
}
private getPreferredColorScheme(): ColorScheme | undefined {
if (this.configurationService.getValue<boolean>(ThemeSettings.DETECT_HC) && this.hostColorService.highContrast) {
if (this.configurationService.getValue(ThemeSettings.DETECT_HC) && this.hostColorService.highContrast) {
return ColorScheme.HIGH_CONTRAST;
}
if (this.configurationService.getValue<boolean>(ThemeSettings.DETECT_COLOR_SCHEME)) {
if (this.configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) {
return this.hostColorService.dark ? ColorScheme.DARK : ColorScheme.LIGHT;
}
return undefined;
......@@ -391,8 +391,8 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
private async applyPreferredColorTheme(type: ColorScheme): Promise<IWorkbenchColorTheme | null> {
const settingId = type === ColorScheme.DARK ? ThemeSettings.PREFERRED_DARK_THEME : type === ColorScheme.LIGHT ? ThemeSettings.PREFERRED_LIGHT_THEME : ThemeSettings.PREFERRED_HC_THEME;
const themeSettingId = this.configurationService.getValue<string>(settingId);
if (themeSettingId) {
const themeSettingId = this.configurationService.getValue(settingId);
if (themeSettingId && typeof themeSettingId === 'string') {
const theme = this.colorThemeRegistry.findThemeBySettingsId(themeSettingId, undefined);
if (theme) {
const configurationTarget = this.settings.findAutoConfigurationTarget(settingId);
......
......@@ -162,7 +162,7 @@ export class UntitledTextEditorModel extends BaseTextEditorModel implements IUnt
}
// Label Format
const configuredLabelFormat = this.textResourceConfigurationService.getValue<string>(this.resource, 'workbench.editor.untitled.labelFormat');
const configuredLabelFormat = this.textResourceConfigurationService.getValue(this.resource, 'workbench.editor.untitled.labelFormat');
if (this.configuredLabelFormat !== configuredLabelFormat && (configuredLabelFormat === 'content' || configuredLabelFormat === 'name')) {
this.configuredLabelFormat = configuredLabelFormat;
......
......@@ -80,7 +80,7 @@ export class WorkspaceTrustEnablementService extends Disposable implements IWork
return false;
}
return this.configurationService.getValue<boolean>(WORKSPACE_TRUST_ENABLED) ?? false;
return !!this.configurationService.getValue(WORKSPACE_TRUST_ENABLED);
}
}
......@@ -308,7 +308,7 @@ export class WorkspaceTrustManagementService extends Disposable implements IWork
}
// User setting
return this.configurationService.getValue<boolean>(WORKSPACE_TRUST_EMPTY_WINDOW) ?? false;
return !!this.configurationService.getValue(WORKSPACE_TRUST_EMPTY_WINDOW);
}
return this.getUrisTrust(this.getWorkspaceUris());
......
......@@ -34,8 +34,8 @@ export class TestTextResourcePropertiesService implements ITextResourcePropertie
}
getEOL(resource: URI, language?: string): string {
const eol = this.configurationService.getValue<string>('files.eol', { overrideIdentifier: language, resource });
if (eol && eol !== 'auto') {
const eol = this.configurationService.getValue('files.eol', { overrideIdentifier: language, resource });
if (eol && typeof eol === 'string' && eol !== 'auto') {
return eol;
}
return (isLinux || isMacintosh) ? '\n' : '\r\n';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册