Skip to content

Commit bc0692c

Browse files
committed
1 parent 5e7f758 commit bc0692c

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ import { distinct } from 'vs/base/common/arrays';
3030
import { DisposableStore } from 'vs/base/common/lifecycle';
3131
import { CellUri } from 'vs/workbench/contrib/notebook/common/notebookCommon';
3232
import { disposableTimeout } from 'vs/base/common/async';
33-
import { isWeb } from 'vs/base/common/platform';
34-
import { IFileService } from 'vs/platform/files/common/files';
3533
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
3634
import { ViewContainerLocation } from 'vs/workbench/common/views';
35+
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
3736

3837
type FileExtensionSuggestionClassification = {
3938
userReaction: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
@@ -103,8 +102,8 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
103102
@IStorageService private readonly storageService: IStorageService,
104103
@IExtensionRecommendationNotificationService private readonly extensionRecommendationNotificationService: IExtensionRecommendationNotificationService,
105104
@IExtensionIgnoredRecommendationsService private readonly extensionIgnoredRecommendationsService: IExtensionIgnoredRecommendationsService,
106-
@IFileService private readonly fileService: IFileService,
107105
@ITASExperimentService private tasExperimentService: ITASExperimentService,
106+
@IWorkspaceContextService private workspaceContextService: IWorkspaceContextService,
108107
) {
109108
super();
110109

@@ -166,18 +165,9 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
166165
return;
167166
}
168167

169-
/* In Web, recommend only when the file can be handled */
170-
if (isWeb) {
171-
if (!this.fileService.hasProvider(uri)) {
172-
return;
173-
}
174-
}
175-
176-
/* In Desktop, recommend only for files with these schemes */
177-
else {
178-
if (![Schemas.untitled, Schemas.file, Schemas.vscodeRemote].includes(uri.scheme)) {
179-
return;
180-
}
168+
const supportedSchemes = distinct([Schemas.untitled, Schemas.file, Schemas.vscodeRemote, ...this.workspaceContextService.getWorkspace().folders.map(folder => folder.uri.scheme)]);
169+
if (!uri || !supportedSchemes.includes(uri.scheme)) {
170+
return;
181171
}
182172

183173
this.promptRecommendationsForModel(model);

0 commit comments

Comments
 (0)