mirror of
https://github.com/coder/code-server.git
synced 2026-05-09 05:47:26 +02:00
chore(vscode): update to 1.56.0
This commit is contained in:
@@ -133,7 +133,7 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
||||
if (vsixs.length) {
|
||||
await Promise.all(vsixs.map(async vsix => {
|
||||
try {
|
||||
const manifest = await this.installVSIX(vsix, force, output);
|
||||
const manifest = await this.installVSIX(vsix, { isBuiltin: false, isMachineScoped }, force, output);
|
||||
if (manifest) {
|
||||
installedExtensionsManifests.push(manifest);
|
||||
}
|
||||
@@ -173,7 +173,7 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
||||
}
|
||||
}
|
||||
|
||||
private async installVSIX(vsix: URI, force: boolean, output: CLIOutput): Promise<IExtensionManifest | null> {
|
||||
private async installVSIX(vsix: URI, installOptions: InstallOptions, force: boolean, output: CLIOutput): Promise<IExtensionManifest | null> {
|
||||
|
||||
const manifest = await this.extensionManagementService.getManifest(vsix);
|
||||
if (!manifest) {
|
||||
@@ -183,7 +183,7 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer
|
||||
const valid = await this.validateVSIX(manifest, force, output);
|
||||
if (valid) {
|
||||
try {
|
||||
await this.extensionManagementService.install(vsix);
|
||||
await this.extensionManagementService.install(vsix, installOptions);
|
||||
output.log(localize('successVsixInstall', "Extension '{0}' was successfully installed.", getBaseLabel(vsix)));
|
||||
return manifest;
|
||||
} catch (error) {
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IProductService, IConfigBasedExtensionTip as IRawConfigBasedExtensionTip } from 'vs/platform/product/common/productService';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IConfigBasedExtensionTip as IRawConfigBasedExtensionTip } from 'vs/base/common/product';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { isNonEmptyArray } from 'vs/base/common/arrays';
|
||||
import { IExtensionTipsService, IExecutableBasedExtensionTip, IWorkspaceTips, IConfigBasedExtensionTip } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
|
||||
@@ -40,7 +40,7 @@ const lastPromptedMediumImpExeTimeStorageKey = 'extensionTips/lastPromptedMedium
|
||||
|
||||
export class ExtensionTipsService extends BaseExtensionTipsService {
|
||||
|
||||
_serviceBrand: any;
|
||||
override _serviceBrand: any;
|
||||
|
||||
private readonly highImportanceExecutableTips: Map<string, IExeBasedExtensionTips> = new Map<string, IExeBasedExtensionTips>();
|
||||
private readonly mediumImportanceExecutableTips: Map<string, IExeBasedExtensionTips> = new Map<string, IExeBasedExtensionTips>();
|
||||
@@ -101,13 +101,13 @@ export class ExtensionTipsService extends BaseExtensionTipsService {
|
||||
});
|
||||
}
|
||||
|
||||
async getImportantExecutableBasedTips(): Promise<IExecutableBasedExtensionTip[]> {
|
||||
override async getImportantExecutableBasedTips(): Promise<IExecutableBasedExtensionTip[]> {
|
||||
const highImportanceExeTips = await this.getValidExecutableBasedExtensionTips(this.highImportanceExecutableTips);
|
||||
const mediumImportanceExeTips = await this.getValidExecutableBasedExtensionTips(this.mediumImportanceExecutableTips);
|
||||
return [...highImportanceExeTips, ...mediumImportanceExeTips];
|
||||
}
|
||||
|
||||
getOtherExecutableBasedTips(): Promise<IExecutableBasedExtensionTip[]> {
|
||||
override getOtherExecutableBasedTips(): Promise<IExecutableBasedExtensionTip[]> {
|
||||
return this.getValidExecutableBasedExtensionTips(this.allOtherExecutableTips);
|
||||
}
|
||||
|
||||
|
||||
@@ -388,12 +388,11 @@ export class ExtensionManagementService extends Disposable implements IExtension
|
||||
publisherDisplayName: extension.publisherDisplayName,
|
||||
};
|
||||
|
||||
let zipPath;
|
||||
let zipPath: string | undefined;
|
||||
try {
|
||||
this.logService.trace('Started downloading extension:', extension.identifier.id);
|
||||
const zip = await this.extensionsDownloader.downloadExtension(extension, operation);
|
||||
zipPath = (await this.extensionsDownloader.downloadExtension(extension, operation)).fsPath;
|
||||
this.logService.info('Downloaded extension:', extension.identifier.id, zipPath);
|
||||
zipPath = zip.fsPath;
|
||||
} catch (error) {
|
||||
throw new ExtensionManagementError(this.joinErrors(error).message, INSTALL_ERROR_DOWNLOADING);
|
||||
}
|
||||
|
||||
@@ -19,8 +19,10 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
|
||||
import { mock } from 'vs/base/test/common/mock';
|
||||
|
||||
class EnvironmentServiceMock extends mock<IEnvironmentService>() {
|
||||
constructor(readonly serviceMachineIdResource: URI) {
|
||||
override readonly serviceMachineIdResource: URI;
|
||||
constructor(serviceMachineIdResource: URI) {
|
||||
super();
|
||||
this.serviceMachineIdResource = serviceMachineIdResource;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +45,6 @@ suite('Extension Gallery Service', () => {
|
||||
const headers = await resolveMarketplaceHeaders(product.version, environmentService, fileService, storageService);
|
||||
assert.ok(isUUID(headers['X-Market-User-Id']));
|
||||
const headers2 = await resolveMarketplaceHeaders(product.version, environmentService, fileService, storageService);
|
||||
assert.equal(headers['X-Market-User-Id'], headers2['X-Market-User-Id']);
|
||||
assert.strictEqual(headers['X-Market-User-Id'], headers2['X-Market-User-Id']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,21 +9,21 @@ suite('Extension Identifier Pattern', () => {
|
||||
|
||||
test('extension identifier pattern', () => {
|
||||
const regEx = new RegExp(EXTENSION_IDENTIFIER_PATTERN);
|
||||
assert.equal(true, regEx.test('publisher.name'));
|
||||
assert.equal(true, regEx.test('publiSher.name'));
|
||||
assert.equal(true, regEx.test('publisher.Name'));
|
||||
assert.equal(true, regEx.test('PUBLISHER.NAME'));
|
||||
assert.equal(true, regEx.test('PUBLISHEr.NAMe'));
|
||||
assert.equal(true, regEx.test('PUBLISHEr.N-AMe'));
|
||||
assert.equal(true, regEx.test('PUB-LISHEr.NAMe'));
|
||||
assert.equal(true, regEx.test('PUB-LISHEr.N-AMe'));
|
||||
assert.equal(true, regEx.test('PUBLISH12Er90.N-A54Me123'));
|
||||
assert.equal(true, regEx.test('111PUBLISH12Er90.N-1111A54Me123'));
|
||||
assert.equal(false, regEx.test('publishername'));
|
||||
assert.equal(false, regEx.test('-publisher.name'));
|
||||
assert.equal(false, regEx.test('publisher.-name'));
|
||||
assert.equal(false, regEx.test('-publisher.-name'));
|
||||
assert.equal(false, regEx.test('publ_isher.name'));
|
||||
assert.equal(false, regEx.test('publisher._name'));
|
||||
assert.strictEqual(true, regEx.test('publisher.name'));
|
||||
assert.strictEqual(true, regEx.test('publiSher.name'));
|
||||
assert.strictEqual(true, regEx.test('publisher.Name'));
|
||||
assert.strictEqual(true, regEx.test('PUBLISHER.NAME'));
|
||||
assert.strictEqual(true, regEx.test('PUBLISHEr.NAMe'));
|
||||
assert.strictEqual(true, regEx.test('PUBLISHEr.N-AMe'));
|
||||
assert.strictEqual(true, regEx.test('PUB-LISHEr.NAMe'));
|
||||
assert.strictEqual(true, regEx.test('PUB-LISHEr.N-AMe'));
|
||||
assert.strictEqual(true, regEx.test('PUBLISH12Er90.N-A54Me123'));
|
||||
assert.strictEqual(true, regEx.test('111PUBLISH12Er90.N-1111A54Me123'));
|
||||
assert.strictEqual(false, regEx.test('publishername'));
|
||||
assert.strictEqual(false, regEx.test('-publisher.name'));
|
||||
assert.strictEqual(false, regEx.test('publisher.-name'));
|
||||
assert.strictEqual(false, regEx.test('-publisher.-name'));
|
||||
assert.strictEqual(false, regEx.test('publ_isher.name'));
|
||||
assert.strictEqual(false, regEx.test('publisher._name'));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user