Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Oct 26, 2022
1 parent 5a4be3b commit 6a993ee
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export class WorkspaceExtensionsConfigService extends Disposable implements IWor
}

async toggleRecommendation(extensionId: string): Promise<void> {
extensionId = extensionId.toLowerCase();
const workspace = this.workspaceContextService.getWorkspace();
const workspaceExtensionsConfigContent = workspace.configuration ? await this.resolveWorkspaceExtensionConfig(workspace.configuration) : undefined;
const workspaceFolderExtensionsConfigContents = new ResourceMap<IExtensionsConfigContent>();
Expand All @@ -98,8 +99,8 @@ export class WorkspaceExtensionsConfigService extends Disposable implements IWor
workspaceFolderExtensionsConfigContents.set(workspaceFolder.uri, extensionsConfigContent);
}));

const isWorkspaceRecommended = workspaceExtensionsConfigContent && workspaceExtensionsConfigContent.recommendations?.some(r => r === extensionId);
const recommendedWorksapceFolders = workspace.folders.filter(workspaceFolder => workspaceFolderExtensionsConfigContents.get(workspaceFolder.uri)?.recommendations?.some(r => r === extensionId));
const isWorkspaceRecommended = workspaceExtensionsConfigContent && workspaceExtensionsConfigContent.recommendations?.some(r => r.toLowerCase() === extensionId);
const recommendedWorksapceFolders = workspace.folders.filter(workspaceFolder => workspaceFolderExtensionsConfigContents.get(workspaceFolder.uri)?.recommendations?.some(r => r.toLowerCase() === extensionId));
const isRecommended = isWorkspaceRecommended || recommendedWorksapceFolders.length > 0;

const workspaceOrFolders = isRecommended
Expand Down

0 comments on commit 6a993ee

Please sign in to comment.