Skip to content

Commit

Permalink
Rebase against the upstream 41ef820
Browse files Browse the repository at this point in the history
vscode-upstream-sha1: 41ef820
  • Loading branch information
Eclipse Che Sync committed Jul 18, 2023
2 parents 019f910 + 41ef820 commit ff67a08
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
1 change: 0 additions & 1 deletion code/src/vs/platform/update/common/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
export interface IUpdate {
version: string;
productVersion: string;
supportsFastUpdate?: boolean;
url?: string;
hash?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class Win32UpdateService extends AbstractUpdateService {

this.availableUpdate = { packagePath };

if (fastUpdatesEnabled && update.supportsFastUpdate) {
if (fastUpdatesEnabled) {
if (this.productService.target === 'user') {
this.doApplyUpdate();
} else {
Expand Down Expand Up @@ -239,7 +239,7 @@ export class Win32UpdateService extends AbstractUpdateService {

this.logService.trace('update#quitAndInstall(): running raw#quitAndInstall()');

if (this.state.update.supportsFastUpdate && this.availableUpdate.updateFilePath) {
if (this.availableUpdate.updateFilePath) {
fs.unlinkSync(this.availableUpdate.updateFilePath);
} else {
spawn(this.availableUpdate.packagePath, ['/silent', '/log', '/mergetasks=runcode,!desktopicon,!quicklaunchicon'], {
Expand All @@ -259,7 +259,7 @@ export class Win32UpdateService extends AbstractUpdateService {
}

const fastUpdatesEnabled = this.configurationService.getValue('update.enableWindowsBackgroundUpdates');
const update: IUpdate = { version: 'unknown', productVersion: 'unknown', supportsFastUpdate: !!fastUpdatesEnabled };
const update: IUpdate = { version: 'unknown', productVersion: 'unknown' };

this.setState(State.Downloading(update));
this.availableUpdate = { packagePath };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,12 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
const validate = () => {
if (!profile && this.userDataProfilesService.profiles.some(p => p.name === quickPick.value)) {
quickPick.validationMessage = localize('profileExists', "Profile with name {0} already exists.", quickPick.value);
quickPick.severity = Severity.Error;
quickPick.severity = Severity.Warning;
return;
}
if (resources.every(resource => !resource.picked)) {
quickPick.validationMessage = localize('invalid configurations', "The profile should contain at least one configuration.");
quickPick.severity = Severity.Error;
quickPick.severity = Severity.Warning;
return;
}
quickPick.severity = Severity.Ignore;
Expand Down Expand Up @@ -542,17 +542,11 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
quickPick.widget = domNode;

const updateOptions = () => {
const index = findOptionIndex();
if (index <= 0) {
return;
}
const option = profileOptions[index];
if (!isString(option.source)) {
for (const resource of resources) {
resource.picked = option.source?.useDefaultFlags?.[resource.id];
}
update();
const option = profileOptions[findOptionIndex()];
for (const resource of resources) {
resource.picked = option.source && !isString(option.source) ? !option.source?.useDefaultFlags?.[resource.id] : true;
}
update();
};

updateOptions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
import { IURLHandler, IURLService } from 'vs/platform/url/common/url';
import { asText, IRequestService } from 'vs/platform/request/common/request';
import { IProductService } from 'vs/platform/product/common/productService';
import { isUndefined } from 'vs/base/common/types';
import { Mutable, isUndefined } from 'vs/base/common/types';
import { Action, ActionRunner, IAction, IActionRunner } from 'vs/base/common/actions';
import { isWeb } from 'vs/base/common/platform';
import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions';
Expand Down Expand Up @@ -204,7 +204,7 @@ export class UserDataProfileImportExportService extends Disposable implements IU
location: ProgressLocation.Window,
command: showWindowLogActionId,
title: localize('resolving uri', "{0}: Resolving profile content...", options?.mode ? localize('preview profile', "Preview Profile") : localize('import profile', "Create Profile")),
}, () => this.resolveProfileTemplate(uri));
}, () => this.resolveProfileTemplate(uri, options));
if (!profileTemplate) {
return;
}
Expand Down Expand Up @@ -348,17 +348,21 @@ export class UserDataProfileImportExportService extends Disposable implements IU
}
}

private async resolveProfileTemplate(uri: URI): Promise<IUserDataProfileTemplate | null> {
private async resolveProfileTemplate(uri: URI, options?: IProfileImportOptions): Promise<IUserDataProfileTemplate | null> {
const profileContent = await this.resolveProfileContent(uri);
if (profileContent === null) {
return null;
}

const profileTemplate: IUserDataProfileTemplate = JSON.parse(profileContent);
const profileTemplate: Mutable<IUserDataProfileTemplate> = JSON.parse(profileContent);
if (!isUserDataProfileTemplate(profileTemplate)) {
throw new Error('Invalid profile content.');
}

if (options?.name) {
profileTemplate.name = options.name;
}

return profileTemplate;
}

Expand Down

0 comments on commit ff67a08

Please sign in to comment.