Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: restore branch for recovery release #139041

Merged
merged 5 commits into from Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion extensions/package.json
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"description": "Dependencies shared by all extensions",
"dependencies": {
"typescript": "4.5.4"
"typescript": "4.5"
},
"scripts": {
"postinstall": "node ./postinstall"
Expand Down
8 changes: 4 additions & 4 deletions extensions/yarn.lock
Expand Up @@ -24,10 +24,10 @@ fast-plist@0.1.2:
resolved "https://registry.yarnpkg.com/fast-plist/-/fast-plist-0.1.2.tgz#a45aff345196006d406ca6cdcd05f69051ef35b8"
integrity sha1-pFr/NFGWAG1AbKbNzQX2kFHvNbg=

typescript@4.5.4:
version "4.5.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8"
integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==
typescript@4.5:
version "4.5.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998"
integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==

vscode-grammar-updater@^1.0.3:
version "1.0.3"
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.63.1",
"distro": "4ca403765dff3e67e788ce19c43428878f156242",
"version": "1.63.0",
"distro": "28dea56425abcfafd4de9d5073e6fadfbf3518f5",
"author": {
"name": "Microsoft Corporation"
},
Expand Down
Expand Up @@ -16,7 +16,7 @@ import { URI } from 'vs/base/common/uri';
import { IHeaders, IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { DefaultIconPath, getFallbackTargetPlarforms, getTargetPlatform, IExtensionGalleryService, IExtensionIdentifier, IExtensionIdentifierWithVersion, IGalleryExtension, IGalleryExtensionAsset, IGalleryExtensionAssets, IGalleryExtensionVersion, InstallOperation, IQueryOptions, IExtensionsControlManifest, isIExtensionIdentifier, isNotWebExtensionInWebTargetPlatform, isTargetPlatformCompatible, ITranslation, SortBy, SortOrder, StatisticType, TargetPlatform, toTargetPlatform, WEB_EXTENSION_TAG, IExtensionIdentifierWithPreRelease } from 'vs/platform/extensionManagement/common/extensionManagement';
import { DefaultIconPath, getFallbackTargetPlarforms, getTargetPlatform, IExtensionGalleryService, IExtensionIdentifier, IExtensionIdentifierWithVersion, IGalleryExtension, IGalleryExtensionAsset, IGalleryExtensionAssets, IGalleryExtensionVersion, InstallOperation, IQueryOptions, IExtensionsControlManifest, isIExtensionIdentifier, isNotWebExtensionInWebTargetPlatform, isTargetPlatformCompatible, ITranslation, SortBy, SortOrder, StatisticType, TargetPlatform, toTargetPlatform, WEB_EXTENSION_TAG } from 'vs/platform/extensionManagement/common/extensionManagement';
import { adoptToGalleryExtensionId, areSameExtensions, getGalleryExtensionId, getGalleryExtensionTelemetryData } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
import { isEngineValid } from 'vs/platform/extensions/common/extensionValidator';
Expand Down Expand Up @@ -506,39 +506,9 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
const { galleryExtensions } = await this.queryGallery(query, CURRENT_TARGET_PLATFORM, CancellationToken.None);
const galleryExtensionsByVersion = galleryExtensions.map(rawGalleryExtension => {
const id = getGalleryExtensionId(rawGalleryExtension.publisher.publisherName, rawGalleryExtension.extensionName);
return { rawGalleryExtension, version: (<IExtensionIdentifierWithVersion | undefined>identifiers.find(identifier => areSameExtensions(identifier, { id })))?.version, preRelease: includePreRelease };
return { rawGalleryExtension, version: (<IExtensionIdentifierWithVersion | undefined>identifiers.find(identifier => areSameExtensions(identifier, { id })))?.version };
});
return this.converToGalleryExtensions(galleryExtensionsByVersion, CURRENT_TARGET_PLATFORM, () => undefined, token);
}

async getExtensions2(identifiers: ReadonlyArray<IExtensionIdentifierWithPreRelease>): Promise<IGalleryExtension[]> {
const names: string[] = []; const ids: string[] = [];
for (const identifier of identifiers) {
if (identifier.uuid) {
ids.push(identifier.uuid);
} else {
names.push(identifier.id.toLowerCase());
}
}
let query = new Query()
.withFlags(Flags.IncludeAssetUri, Flags.IncludeStatistics, Flags.IncludeCategoryAndTags, Flags.IncludeFiles, Flags.IncludeVersionProperties, Flags.IncludeLatestVersionOnly)
.withPage(1, identifiers.length)
.withFilter(FilterType.Target, 'Microsoft.VisualStudio.Code');
if (ids.length) {
query = query.withFilter(FilterType.ExtensionId, ...ids);
}
if (names.length) {
query = query.withFilter(FilterType.ExtensionId, ...names);
}

const { galleryExtensions: rawGalleryExtensions } = await this.queryGallery(query, CURRENT_TARGET_PLATFORM, CancellationToken.None);
const rawGalleryExtensionsInput = rawGalleryExtensions.map(rawGalleryExtension => {
const id = getGalleryExtensionId(rawGalleryExtension.publisher.publisherName, rawGalleryExtension.extensionName);
const identifier = identifiers.find(identifier => areSameExtensions(identifier, { id, uuid: rawGalleryExtension.extensionId }));
return { rawGalleryExtension, preRelease: !!identifier?.preRelease };
});

return this.converToGalleryExtensions(rawGalleryExtensionsInput, CURRENT_TARGET_PLATFORM, () => undefined, CancellationToken.None);
return this.converToGalleryExtensions(galleryExtensionsByVersion, includePreRelease, CURRENT_TARGET_PLATFORM, () => undefined, token);
}

async getCompatibleExtension(arg1: IExtensionIdentifier | IGalleryExtension, includePreRelease: boolean, targetPlatform: TargetPlatform): Promise<IGalleryExtension | null> {
Expand Down Expand Up @@ -683,43 +653,43 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi

const { galleryExtensions, total } = await this.queryGallery(query, CURRENT_TARGET_PLATFORM, token);
const telemetryData = (index: number) => ({ index: ((query.pageNumber - 1) * query.pageSize) + index, querySource: options.source });
const extensions = await this.converToGalleryExtensions(galleryExtensions.map(rawGalleryExtension => ({ rawGalleryExtension, preRelease: !!options.includePreRelease })), CURRENT_TARGET_PLATFORM, telemetryData, token);
const extensions = await this.converToGalleryExtensions(galleryExtensions.map(rawGalleryExtension => ({ rawGalleryExtension })), !!options.includePreRelease, CURRENT_TARGET_PLATFORM, telemetryData, token);
const getPage = async (pageIndex: number, ct: CancellationToken) => {
if (ct.isCancellationRequested) {
throw canceled();
}
const nextPageQuery = query.withPage(pageIndex + 1);
const { galleryExtensions } = await this.queryGallery(nextPageQuery, CURRENT_TARGET_PLATFORM, ct);
return await this.converToGalleryExtensions(galleryExtensions.map(rawGalleryExtension => ({ rawGalleryExtension, preRelease: !!options.includePreRelease })), CURRENT_TARGET_PLATFORM, telemetryData, token);
return await this.converToGalleryExtensions(galleryExtensions.map(rawGalleryExtension => ({ rawGalleryExtension })), !!options.includePreRelease, CURRENT_TARGET_PLATFORM, telemetryData, token);
};

return { firstPage: extensions, total, pageSize: query.pageSize, getPage } as IPager<IGalleryExtension>;
}

private async converToGalleryExtensions(rawGalleryExtensions: { rawGalleryExtension: IRawGalleryExtension, preRelease: boolean, version?: string }[], targetPlatform: TargetPlatform, telemetryData: (index: number) => IStringDictionary<any> | undefined, token: CancellationToken): Promise<IGalleryExtension[]> {
const toExtensionWithLatestVersion = (galleryExtension: IRawGalleryExtension, index: number, hasReleaseVersion: boolean, preRelease: boolean): IGalleryExtension => {
private async converToGalleryExtensions(rawGalleryExtensions: { rawGalleryExtension: IRawGalleryExtension, version?: string }[], includePreRelease: boolean, targetPlatform: TargetPlatform, telemetryData: (index: number) => IStringDictionary<any> | undefined, token: CancellationToken): Promise<IGalleryExtension[]> {
const toExtensionWithLatestVersion = (galleryExtension: IRawGalleryExtension, index: number, hasReleaseVersion: boolean): IGalleryExtension => {
const allTargetPlatforms = getAllTargetPlatforms(galleryExtension);
let latestVersion = galleryExtension.versions[0];
latestVersion = galleryExtension.versions.find(version => version.version === latestVersion.version && isTargetPlatformCompatible(getTargetPlatformForExtensionVersion(version), allTargetPlatforms, targetPlatform)) || latestVersion;
if (isPreReleaseVersion(latestVersion) && !preRelease) {
if (isPreReleaseVersion(latestVersion) && !includePreRelease) {
latestVersion = galleryExtension.versions.find(version => version.version !== latestVersion.version && !isPreReleaseVersion(version)) || latestVersion;
}
return toExtension(galleryExtension, latestVersion, allTargetPlatforms, hasReleaseVersion, telemetryData(index));
};
const result: [number, IGalleryExtension][] = [];
const preReleaseVersions = new Map<string, { index: number, preRelease: boolean }>();
const preReleaseVersions = new Map<string, number>();
for (let index = 0; index < rawGalleryExtensions.length; index++) {
const { rawGalleryExtension, version, preRelease } = rawGalleryExtensions[index];
const { rawGalleryExtension, version } = rawGalleryExtensions[index];
const hasReleaseVersion = rawGalleryExtension.versions.some(version => !isPreReleaseVersion(version));
if (version) {
const versionAsset = rawGalleryExtension.versions.find(v => v.version === version);
if (versionAsset) {
result.push([index, toExtension(rawGalleryExtension, versionAsset, getAllTargetPlatforms(rawGalleryExtension), hasReleaseVersion)]);
}
} else {
const extension = toExtensionWithLatestVersion(rawGalleryExtension, index, hasReleaseVersion, preRelease);
const extension = toExtensionWithLatestVersion(rawGalleryExtension, index, hasReleaseVersion);
if (extension.properties.isPreReleaseVersion) {
preReleaseVersions.set(extension.identifier.uuid, { index, preRelease });
preReleaseVersions.set(extension.identifier.uuid, index);
} else {
result.push([index, extension]);
}
Expand All @@ -743,8 +713,8 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
}
for (const rawGalleryExtension of galleryExtensions) {
const hasReleaseVersion = rawGalleryExtension.versions.some(version => !isPreReleaseVersion(version));
const { index, preRelease } = preReleaseVersions.get(rawGalleryExtension.extensionId)!;
const extension = toExtensionWithLatestVersion(rawGalleryExtension, index, hasReleaseVersion, preRelease);
const index = preReleaseVersions.get(rawGalleryExtension.extensionId)!;
const extension = toExtensionWithLatestVersion(rawGalleryExtension, index, hasReleaseVersion);
result.push([index, extension]);
}
}
Expand Down
Expand Up @@ -228,10 +228,6 @@ export interface IExtensionIdentifierWithVersion extends IExtensionIdentifier {
version: string;
}

export interface IExtensionIdentifierWithPreRelease extends IExtensionIdentifier {
preRelease: boolean;
}

export interface IGalleryExtensionIdentifier extends IExtensionIdentifier {
uuid: string;
}
Expand Down Expand Up @@ -272,7 +268,7 @@ export interface IGalleryMetadata {
id: string;
publisherId: string;
publisherDisplayName: string;
isPreReleaseVersion: boolean,
isPreReleaseVersion: boolean,
}

export type Metadata = Partial<IGalleryMetadata & { isMachineScoped: boolean; isBuiltin: boolean; preRelease: boolean, installedTimestamp: number }>;
Expand Down Expand Up @@ -342,7 +338,6 @@ export interface IExtensionGalleryService {
query(options: IQueryOptions, token: CancellationToken): Promise<IPager<IGalleryExtension>>;
getExtensions(identifiers: ReadonlyArray<IExtensionIdentifier | IExtensionIdentifierWithVersion>, token: CancellationToken): Promise<IGalleryExtension[]>;
getExtensions(identifiers: ReadonlyArray<IExtensionIdentifier | IExtensionIdentifierWithVersion>, includePreRelease: boolean, token: CancellationToken): Promise<IGalleryExtension[]>;
getExtensions2(identifiers: ReadonlyArray<IExtensionIdentifierWithPreRelease>): Promise<IGalleryExtension[]>;
download(extension: IGalleryExtension, location: URI, operation: InstallOperation): Promise<void>;
reportStatistic(publisher: string, name: string, version: string, type: StatisticType): Promise<void>;
getReadme(extension: IGalleryExtension, token: CancellationToken): Promise<string>;
Expand Down
Expand Up @@ -379,7 +379,7 @@ class Extensions extends Disposable {
private installed: Extension[] = [];

constructor(
readonly server: IExtensionManagementServer,
private readonly server: IExtensionManagementServer,
private readonly stateProvider: IExtensionStateProvider<ExtensionState>,
@IExtensionGalleryService private readonly galleryService: IExtensionGalleryService,
@IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService,
Expand Down Expand Up @@ -1018,22 +1018,21 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
.then(undefined, err => null);
}

private async syncWithGallery(): Promise<void> {
const identifiers: (IExtensionIdentifier & { preRelease: boolean })[] = [], names: string[] = [];
private syncWithGallery(): Promise<void> {
const ids: string[] = [], names: string[] = [];
for (const installed of this.local) {
if (installed.type === ExtensionType.User) {
if (installed.identifier.uuid) {
identifiers.push({ ...installed.identifier, preRelease: !!installed.local?.isPreReleaseVersion || !!installed.local?.preRelease });
ids.push(installed.identifier.uuid);
} else {
names.push(installed.identifier.id);
}
}
}

const promises: Promise<any>[] = [];
if (identifiers.length) {
const extensionsControlManifest = await this.extensionManagementService.getExtensionsControlManifest();
promises.push(this.galleryService.getExtensions2(identifiers).then(galleryExtensions => galleryExtensions.forEach(gallery => this.fromGallery(gallery, extensionsControlManifest))));
const promises: Promise<IPager<IExtension>>[] = [];
if (ids.length) {
promises.push(this.queryGallery({ ids, pageSize: ids.length }, CancellationToken.None));
}
if (names.length) {
promises.push(this.queryGallery({ names, pageSize: names.length }, CancellationToken.None));
Expand Down
7 changes: 3 additions & 4 deletions src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Expand Up @@ -179,14 +179,12 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
private _labelComputer?: TerminalLabelComputer;
private _userHome?: string;
private _hasScrollBar?: boolean;
private _target?: TerminalLocation | undefined;

get target(): TerminalLocation | undefined { return this._target; }
get target(): TerminalLocation | undefined { return this.xterm?.target; }
set target(value: TerminalLocation | undefined) {
if (this.xterm) {
this.xterm.target = value;
}
this._target = value;
}

get instanceId(): number { return this._instanceId; }
Expand Down Expand Up @@ -561,7 +559,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
throw new Error('Terminal disposed of during xterm.js creation');
}

const xterm = this._instantiationService.createInstance(XtermTerminal, Terminal, this._configHelper, this._cols, this._rows, this.target || TerminalLocation.Panel);
const xterm = this._instantiationService.createInstance(XtermTerminal, Terminal, this._configHelper, this._cols, this._rows);
this.xterm = xterm;
const lineDataEventAddon = new LineDataEventAddon();
this.xterm.raw.loadAddon(lineDataEventAddon);
Expand Down Expand Up @@ -703,6 +701,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
throw new Error('xterm elements not set after open');
}


this._setAriaLabel(xterm.raw, this._instanceId, this._title);

xterm.raw.attachCustomKeyEventHandler((event: KeyboardEvent): boolean => {
Expand Down