Skip to content

Commit

Permalink
More parts of #125422
Browse files Browse the repository at this point in the history
  • Loading branch information
lramos15 committed Jul 9, 2021
1 parent c9b3120 commit a08a485
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/vs/platform/list/browser/listService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
newOptions = { ...newOptions, renderIndentGuides };
}
if (e.affectsConfiguration(listSmoothScrolling)) {
const smoothScrolling = Boolean(configurationService.getValue<boolean>(listSmoothScrolling));
const smoothScrolling = Boolean(!!configurationService.getValue(listSmoothScrolling));

This comment has been minimized.

Copy link
@yo1dog

yo1dog Aug 27, 2021

Noticed the !! added here is superfluous as it is already passed to Boolean(). Same with line 1169.

This comment has been minimized.

Copy link
@lramos15

lramos15 Aug 30, 2021

Author Member

Fixed by 9c6b9f0. Thank you!

newOptions = { ...newOptions, smoothScrolling };
}
if (e.affectsConfiguration(keyboardNavigationSettingKey)) {
Expand All @@ -1166,7 +1166,7 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
newOptions = { ...newOptions, automaticKeyboardNavigation: getAutomaticKeyboardNavigation() };
}
if (e.affectsConfiguration(horizontalScrollingKey) && options.horizontalScrolling === undefined) {
const horizontalScrolling = Boolean(configurationService.getValue<boolean>(horizontalScrollingKey));
const horizontalScrolling = Boolean(!!configurationService.getValue(horizontalScrollingKey));
newOptions = { ...newOptions, horizontalScrolling };
}
if (e.affectsConfiguration(treeExpandMode) && options.expandOnlyOnTwistieClick === undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/platform/terminal/node/terminalProfiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function detectAvailableProfiles(
includeDetectedProfiles,
fsProvider,
logService,
configurationService.getValue<boolean>(TerminalSettingId.UseWslProfiles) !== false,
configurationService.getValue(TerminalSettingId.UseWslProfiles) !== false,
profiles && typeof profiles === 'object' ? { ...profiles } : configurationService.getValue<{ [key: string]: ITerminalProfileObject }>(TerminalSettingId.ProfilesWindows),
typeof defaultProfile === 'string' ? defaultProfile : configurationService.getValue<string>(TerminalSettingId.DefaultProfileWindows),
testPwshSourcePaths,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class Win32UpdateService extends AbstractUpdateService {
.then(() => updatePackagePath);
});
}).then(packagePath => {
const fastUpdatesEnabled = this.configurationService.getValue<boolean>('update.enableWindowsBackgroundUpdates');
const fastUpdatesEnabled = this.configurationService.getValue('update.enableWindowsBackgroundUpdates');

this.availableUpdate = { packagePath };

Expand Down
6 changes: 3 additions & 3 deletions src/vs/platform/userDataSync/common/keybindingsSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,15 @@ export class KeybindingsSynchroniser extends AbstractJsonFileSynchroniser implem
}

private syncKeybindingsPerPlatform(): boolean {
let userValue = this.configurationService.inspect<boolean>('settingsSync.keybindingsPerPlatform').userValue;
let userValue = !!this.configurationService.inspect('settingsSync.keybindingsPerPlatform').userValue;
if (userValue !== undefined) {
return userValue;
}
userValue = this.configurationService.inspect<boolean>('sync.keybindingsPerPlatform').userValue;
userValue = !!this.configurationService.inspect('sync.keybindingsPerPlatform').userValue;
if (userValue !== undefined) {
return userValue;
}
return this.configurationService.getValue<boolean>('settingsSync.keybindingsPerPlatform');
return !!this.configurationService.getValue('settingsSync.keybindingsPerPlatform');
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/browser/actions/developerActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class ToggleScreencastModeAction extends Action2 {
const event = new StandardKeyboardEvent(e);
const shortcut = keybindingService.softDispatch(event, event.target);

if (shortcut || !configurationService.getValue<boolean>('screencastMode.onlyKeyboardShortcuts')) {
if (shortcut || !configurationService.getValue('screencastMode.onlyKeyboardShortcuts')) {
if (
event.ctrlKey || event.altKey || event.metaKey || event.shiftKey
|| length > 20
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/browser/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
if (!this.state.zenMode.active) {

// Statusbar visibility
const newStatusbarHiddenValue = !this.configurationService.getValue<boolean>(Settings.STATUSBAR_VISIBLE);
const newStatusbarHiddenValue = !this.configurationService.getValue(Settings.STATUSBAR_VISIBLE);
if (newStatusbarHiddenValue !== this.state.statusBar.hidden) {
this.setStatusBarHidden(newStatusbarHiddenValue, skipLayout);
}

// Activitybar visibility
const newActivityBarHiddenValue = !this.configurationService.getValue<boolean>(Settings.ACTIVITYBAR_VISIBLE);
const newActivityBarHiddenValue = !this.configurationService.getValue(Settings.ACTIVITYBAR_VISIBLE);
if (newActivityBarHiddenValue !== this.state.activityBar.hidden) {
this.setActivityBarHidden(newActivityBarHiddenValue, skipLayout);
}
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/browser/parts/editor/editorCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,14 @@ function registerDiffEditorCommands(): void {
function toggleDiffSideBySide(accessor: ServicesAccessor): void {
const configurationService = accessor.get(IConfigurationService);

const newValue = !configurationService.getValue<boolean>('diffEditor.renderSideBySide');
const newValue = !configurationService.getValue('diffEditor.renderSideBySide');
configurationService.updateValue('diffEditor.renderSideBySide', newValue);
}

function toggleDiffIgnoreTrimWhitespace(accessor: ServicesAccessor): void {
const configurationService = accessor.get(IConfigurationService);

const newValue = !configurationService.getValue<boolean>('diffEditor.ignoreTrimWhitespace');
const newValue = !configurationService.getValue('diffEditor.ignoreTrimWhitespace');
configurationService.updateValue('diffEditor.ignoreTrimWhitespace', newValue);
}

Expand Down Expand Up @@ -948,7 +948,7 @@ function registerOtherEditorCommands(): void {
handler: accessor => {
const configurationService = accessor.get(IConfigurationService);

const currentSetting = configurationService.getValue<boolean>('workbench.editor.enablePreview');
const currentSetting = configurationService.getValue('workbench.editor.enablePreview');
const newSetting = currentSetting === true ? false : true;
configurationService.updateValue('workbench.editor.enablePreview', newSetting);
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/browser/parts/editor/editorPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class EditorMemento<T> implements IEditorMemento<T> {
}

private updateConfiguration(): void {
this.shareEditorState = this.configurationService.getValue<boolean>(undefined, 'workbench.editor.sharedViewState') === true;
this.shareEditorState = this.configurationService.getValue(undefined, 'workbench.editor.sharedViewState') === true;
}

saveEditorState(group: IEditorGroup, resource: URI, state: T): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class NativeRemoteExtensionManagementService extends WebRemoteExtensionMa
}

private async doInstallFromGallery(extension: IGalleryExtension, installOptions?: InstallOptions): Promise<ILocalExtension> {
if (this.configurationService.getValue<boolean>('remote.downloadExtensionsLocally')) {
if (this.configurationService.getValue('remote.downloadExtensionsLocally')) {
this.logService.trace(`Download '${extension.identifier.id}' extension locally and install`);
return this.downloadCompatibleAndInstall(extension);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ export class UntitledTextEditorModel extends BaseTextEditorModel implements IUnt
private onConfigurationChange(fromEvent: boolean): void {

// Encoding
const configuredEncoding = this.textResourceConfigurationService.getValue<string>(this.resource, 'files.encoding');
if (this.configuredEncoding !== configuredEncoding) {
const configuredEncoding = this.textResourceConfigurationService.getValue(this.resource, 'files.encoding');
if (this.configuredEncoding !== configuredEncoding && typeof configuredEncoding === 'string') {
this.configuredEncoding = configuredEncoding;

if (fromEvent && !this.preferredEncoding) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class UserDataSyncUtilService implements IUserDataSyncUtilService {
}
return {
eol: this.textResourcePropertiesService.getEOL(resource),
insertSpaces: this.textResourceConfigurationService.getValue<boolean>(resource, 'editor.insertSpaces'),
insertSpaces: !!this.textResourceConfigurationService.getValue(resource, 'editor.insertSpaces'),
tabSize: this.textResourceConfigurationService.getValue(resource, 'editor.tabSize')
};
}
Expand Down

0 comments on commit a08a485

Please sign in to comment.