Skip to content

Commit

Permalink
fix #223509 - Show the workspace extension in recommended section eve…
Browse files Browse the repository at this point in the history
…n if it is installed
  • Loading branch information
sandy081 committed Jul 29, 2024
1 parent 0c5af5d commit 8121678
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ type ExtensionsLoadClassification = {
export class Extension implements IExtension {

public enablementState: EnablementState = EnablementState.EnabledGlobally;
public readonly resourceExtension: IResourceExtension | undefined;

private galleryResourcesCache = new Map<string, any>();

Expand All @@ -97,7 +96,23 @@ export class Extension implements IExtension {
@IFileService private readonly fileService: IFileService,
@IProductService private readonly productService: IProductService
) {
this.resourceExtension = resourceExtensionInfo?.resourceExtension;
}

get resourceExtension(): IResourceExtension | undefined {
if (this.resourceExtensionInfo) {
return this.resourceExtensionInfo.resourceExtension;
}
if (this.local?.isWorkspaceScoped) {
return {
type: 'resource',
identifier: this.local.identifier,
location: this.local.location,
manifest: this.local.manifest,
changelogUri: this.local.changelogUrl,
readmeUri: this.local.readmeUrl,
};
}
return undefined;
}

get gallery(): IGalleryExtension | undefined {
Expand Down

0 comments on commit 8121678

Please sign in to comment.