Skip to content

Commit 4f95d36

Browse files
Add logs
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
1 parent 476c074 commit 4f95d36

15 files changed

Lines changed: 32 additions & 0 deletions

File tree

code/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ export abstract class AbstractExtensionManagementService extends CommontExtensio
617617
// filter out known extensions
618618
const ids = dependenciesAndPackExtensions.filter(id => knownIdentifiers.every(galleryIdentifier => !areSameExtensions(galleryIdentifier, { id })));
619619
if (ids.length) {
620+
console.error('//// BEFORE 1111 getExtensions ');
620621
const galleryExtensions = await this.galleryService.getExtensions(ids.map(id => ({ id, preRelease: preferPreRelease })), CancellationToken.None);
621622
for (const galleryExtension of galleryExtensions) {
622623
if (knownIdentifiers.find(identifier => areSameExtensions(identifier, galleryExtension.identifier))) {
@@ -656,6 +657,7 @@ export abstract class AbstractExtensionManagementService extends CommontExtensio
656657
const deprecationInfo = extensionsControlManifest.deprecated[extension.identifier.id.toLowerCase()];
657658
if (deprecationInfo?.extension?.autoMigrate) {
658659
this.logService.info(`The '${extension.identifier.id}' extension is deprecated, fetching the compatible '${deprecationInfo.extension.id}' extension instead.`);
660+
console.error('//// BEFORE 2222 getExtensions ');
659661
compatibleExtension = (await this.galleryService.getExtensions([{ id: deprecationInfo.extension.id, preRelease: deprecationInfo.extension.preRelease }], { targetPlatform: await this.getTargetPlatform(), compatible: true, productVersion }, CancellationToken.None))[0];
660662
if (!compatibleExtension) {
661663
throw new ExtensionManagementError(nls.localize('notFoundDeprecatedReplacementExtension', "Can't install '{0}' extension since it was deprecated and the replacement extension '{1}' can't be found.", extension.identifier.id, deprecationInfo.extension.id), ExtensionManagementErrorCode.Deprecated);
@@ -675,6 +677,7 @@ export abstract class AbstractExtensionManagementService extends CommontExtensio
675677
throw new ExtensionManagementError(nls.localize('incompatibleAPI', "Can't install '{0}' extension. {1}", extension.displayName ?? extension.identifier.id, incompatibleApiProposalsMessages[0]), ExtensionManagementErrorCode.IncompatibleApi);
676678
}
677679
/** If no compatible release version is found, check if the extension has a release version or not and throw relevant error */
680+
console.error('//// BEFORE 333 getExtensions ');
678681
if (!installPreRelease && extension.hasPreReleaseVersion && extension.properties.isPreReleaseVersion && (await this.galleryService.getExtensions([extension.identifier], CancellationToken.None))[0]) {
679682
throw new ExtensionManagementError(nls.localize('notFoundReleaseExtension', "Can't install release version of '{0}' extension because it has no release version.", extension.displayName ?? extension.identifier.id), ExtensionManagementErrorCode.ReleaseVersionNotFound);
680683
}
@@ -700,6 +703,7 @@ export abstract class AbstractExtensionManagementService extends CommontExtensio
700703
let compatibleExtension: IGalleryExtension | null = null;
701704

702705
if (!sameVersion && extension.hasPreReleaseVersion && extension.properties.isPreReleaseVersion !== includePreRelease) {
706+
console.error('//// BEFORE 444 getExtensions ');
703707
compatibleExtension = (await this.galleryService.getExtensions([{ ...extension.identifier, preRelease: includePreRelease }], { targetPlatform, compatible: true, productVersion }, CancellationToken.None))[0] || null;
704708
}
705709

@@ -709,6 +713,7 @@ export abstract class AbstractExtensionManagementService extends CommontExtensio
709713

710714
if (!compatibleExtension) {
711715
if (sameVersion) {
716+
console.error('//// BEFORE 555 getExtensions ');
712717
compatibleExtension = (await this.galleryService.getExtensions([{ ...extension.identifier, version: extension.version }], { targetPlatform, compatible: true, productVersion }, CancellationToken.None))[0] || null;
713718
} else {
714719
compatibleExtension = await this.galleryService.getCompatibleExtension(extension, includePreRelease, targetPlatform, productVersion);

code/src/vs/platform/extensionManagement/common/extensionGalleryService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ export abstract class AbstractExtensionGalleryService implements IExtensionGalle
852852
if (this.allowedExtensionsService.isAllowed({ id: extension.identifier.id, publisherDisplayName: extension.publisherDisplayName }) !== true) {
853853
return null;
854854
}
855+
console.error('//// BEFORE 666 getExtensions ');
855856
const result = await this.getExtensions([{
856857
...extension.identifier,
857858
preRelease: includePreRelease,

code/src/vs/platform/extensionManagement/common/extensionManagementCLI.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export class ExtensionManagementCLI {
138138
}
139139

140140
this.logger.trace(localize({ key: 'updateExtensionsQuery', comment: ['Placeholder is for the count of extensions'] }, "Fetching latest versions for {0} extensions", installedExtensionsQuery.length));
141+
console.error('//// BEFORE 777 getExtensions ');
141142
const availableVersions = await this.extensionGalleryService.getExtensions(installedExtensionsQuery, { compatible: true }, CancellationToken.None);
142143

143144
const extensionsToUpdate: InstallExtensionInfo[] = [];
@@ -280,6 +281,7 @@ export class ExtensionManagementCLI {
280281
}
281282
}
282283
if (extensionInfos.length) {
284+
console.error('//// BEFORE 888 getExtensions ');
283285
const result = await this.extensionGalleryService.getExtensions(extensionInfos, { targetPlatform }, CancellationToken.None);
284286
for (const extension of result) {
285287
galleryExtensions.set(extension.identifier.id.toLowerCase(), extension);

code/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export async function migrateUnsupportedExtensions(extensionManagementService: I
3838
continue;
3939
}
4040

41+
console.error('//// BEFORE 999 getExtensions ');
4142
const gallery = (await galleryService.getExtensions([{ id: preReleaseExtensionId, preRelease }], { targetPlatform: await extensionManagementService.getTargetPlatform(), compatible: true }, CancellationToken.None))[0];
4243
if (!gallery) {
4344
logService.info(`Skipping migrating '${unsupportedExtension.identifier.id}' extension because, the comaptible target '${preReleaseExtensionId}' extension is not found`);

code/src/vs/platform/extensionManagement/node/extensionManagementService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,10 @@ class InstallExtensionInProfileTask extends AbstractExtensionTask<ILocalExtensio
11571157

11581158
private async updateMetadata(extension: ILocalExtension, token: CancellationToken): Promise<void> {
11591159
try {
1160+
console.error('//// BEFORE 10 getExtensions ');
11601161
let [galleryExtension] = await this.galleryService.getExtensions([{ id: extension.identifier.id, version: extension.manifest.version }], token);
11611162
if (!galleryExtension) {
1163+
console.error('//// BEFORE 11 getExtensions ');
11621164
[galleryExtension] = await this.galleryService.getExtensions([{ id: extension.identifier.id }], token);
11631165
}
11641166
if (galleryExtension) {

code/src/vs/platform/userDataSync/common/extensionsSync.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ export class LocalExtensionsProvider {
445445

446446
// User Extension Sync: Install/Update, Enablement & State
447447
const version = e.pinned ? e.version : undefined;
448+
console.error('//// BEFORE 12 getExtensions ');
448449
const extension = (await this.extensionGalleryService.getExtensions([{ ...e.identifier, version, preRelease: version ? undefined : e.preRelease }], CancellationToken.None))[0];
449450

450451
/* Update extension state only if

code/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ export class ExtensionEditor extends EditorPane {
520520
if (!preRelease && !extension.hasReleaseVersion) {
521521
return null;
522522
}
523+
console.error('//// BEFORE 13 getExtensions ');
523524
return (await this.extensionGalleryService.getExtensions([{ ...extension.identifier, preRelease, hasPreRelease: extension.hasPreReleaseVersion }], CancellationToken.None))[0] || null;
524525
}
525526

code/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ export class PromptExtensionInstallFailureAction extends Action {
262262
return undefined;
263263
}
264264

265+
console.error('//// BEFORE 14 getExtensions ');
265266
const [extension] = await this.galleryService.getExtensions([{
266267
...this.extension.identifier,
267268
version: this.version
@@ -3077,6 +3078,7 @@ export class InstallLocalExtensionsInRemoteAction extends AbstractInstallExtensi
30773078
const targetPlatform = await this.extensionManagementServerService.remoteExtensionManagementServer!.extensionManagementService.getTargetPlatform();
30783079
await Promises.settled(localExtensionsToInstall.map(async extension => {
30793080
if (this.extensionGalleryService.isEnabled()) {
3081+
console.error('//// BEFORE 15 getExtensions ');
30803082
const gallery = (await this.extensionGalleryService.getExtensions([{ ...extension.identifier, preRelease: !!extension.local?.preRelease }], { targetPlatform, compatible: true }, CancellationToken.None))[0];
30813083
if (gallery) {
30823084
galleryExtensions.push(gallery);
@@ -3136,6 +3138,7 @@ export class InstallRemoteExtensionsInLocalAction extends AbstractInstallExtensi
31363138
const targetPlatform = await this.extensionManagementServerService.localExtensionManagementServer!.extensionManagementService.getTargetPlatform();
31373139
await Promises.settled(extensions.map(async extension => {
31383140
if (this.extensionGalleryService.isEnabled()) {
3141+
console.error('//// BEFORE 16 getExtensions ');
31393142
const gallery = (await this.extensionGalleryService.getExtensions([{ ...extension.identifier, preRelease: !!extension.local?.preRelease }], { targetPlatform, compatible: true }, CancellationToken.None))[0];
31403143
if (gallery) {
31413144
galleryExtensions.push(gallery);

code/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class InstallExtensionQuickAccessProvider extends PickerQuickAccessProvid
5252

5353
private async getPicksForExtensionId(filter: string, fallback: IPickerQuickAccessItem, token: CancellationToken): Promise<Array<IPickerQuickAccessItem | IQuickPickSeparator>> {
5454
try {
55+
console.error('//// BEFORE 17 getExtensions ');
5556
const [galleryExtension] = await this.galleryService.getExtensions([{ id: filter }], token);
5657
if (token.isCancellationRequested) {
5758
return []; // return early if canceled

code/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ class Extensions extends Disposable {
702702
extensionsToQuery.push(extension);
703703
}
704704
if (extensionsToQuery.length) {
705+
console.error('//// BEFORE 18 getExtensions ');
705706
const queryResult = await this.galleryService.getExtensions(extensionsToQuery.map(e => ({ ...e.identifier, version: e.version })), CancellationToken.None);
706707
const queriedIds: string[] = [];
707708
const missingIds: string[] = [];
@@ -749,6 +750,7 @@ class Extensions extends Disposable {
749750
}
750751
}));
751752
if (compatibleGalleryExtensionsToFetch.length) {
753+
console.error('//// BEFORE 19 getExtensions ');
752754
const result = await this.galleryService.getExtensions(compatibleGalleryExtensionsToFetch, { targetPlatform, compatible: true, queryAllVersions: true, productVersion }, CancellationToken.None);
753755
compatibleGalleryExtensions.push(...result);
754756
}
@@ -915,6 +917,7 @@ class Extensions extends Disposable {
915917
if (!this.galleryService.isEnabled()) {
916918
return;
917919
}
920+
console.error('//// BEFORE 20 getExtensions ');
918921
const galleryExtensions = await this.galleryService.getExtensions(toMatch.map(e => ({ ...e.identifier, preRelease: e.local?.preRelease })), { compatible: true, targetPlatform: await this.server.extensionManagementService.getTargetPlatform() }, CancellationToken.None);
919922
for (const extension of extensions) {
920923
const compatible = galleryExtensions.find(e => areSameExtensions(e.identifier, extension.identifier));
@@ -1397,6 +1400,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
13971400

13981401
extensionInfos.forEach(e => e.preRelease = e.preRelease ?? this.extensionManagementService.preferPreReleases);
13991402
const extensionsControlManifest = await this.extensionManagementService.getExtensionsControlManifest();
1403+
console.error('//// BEFORE 21 getExtensions ');
14001404
const galleryExtensions = await this.galleryService.getExtensions(extensionInfos, arg1, arg2);
14011405
this.syncInstalledExtensionsWithGallery(galleryExtensions);
14021406
return galleryExtensions.map(gallery => this.fromGallery(gallery, extensionsControlManifest));
@@ -1937,6 +1941,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
19371941
count: infos.length,
19381942
});
19391943
this.logService.trace(`Checking updates for extensions`, infos.map(e => e.id).join(', '));
1944+
console.error('//// BEFORE 22 getExtensions ');
19401945
const galleryExtensions = await this.galleryService.getExtensions(infos, { targetPlatform, compatible: true, productVersion: this.getProductVersion(), updateCheck: true }, CancellationToken.None);
19411946
if (galleryExtensions.length) {
19421947
await this.syncInstalledExtensionsWithGallery(galleryExtensions, infos);
@@ -2109,6 +2114,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
21092114
}
21102115
}
21112116
if (infos.length) {
2117+
console.error('//// BEFORE 23 getExtensions ');
21122118
const galleryExtensions = await this.galleryService.getExtensions(infos, CancellationToken.None);
21132119
if (galleryExtensions.length) {
21142120
await this.syncInstalledExtensionsWithGallery(galleryExtensions);

0 commit comments

Comments
 (0)