@@ -30,10 +30,9 @@ import { distinct } from 'vs/base/common/arrays';
30
30
import { DisposableStore } from 'vs/base/common/lifecycle' ;
31
31
import { CellUri } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
32
32
import { disposableTimeout } from 'vs/base/common/async' ;
33
- import { isWeb } from 'vs/base/common/platform' ;
34
- import { IFileService } from 'vs/platform/files/common/files' ;
35
33
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite' ;
36
34
import { ViewContainerLocation } from 'vs/workbench/common/views' ;
35
+ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace' ;
37
36
38
37
type FileExtensionSuggestionClassification = {
39
38
userReaction : { classification : 'SystemMetaData' , purpose : 'FeatureInsight' } ;
@@ -103,8 +102,8 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
103
102
@IStorageService private readonly storageService : IStorageService ,
104
103
@IExtensionRecommendationNotificationService private readonly extensionRecommendationNotificationService : IExtensionRecommendationNotificationService ,
105
104
@IExtensionIgnoredRecommendationsService private readonly extensionIgnoredRecommendationsService : IExtensionIgnoredRecommendationsService ,
106
- @IFileService private readonly fileService : IFileService ,
107
105
@ITASExperimentService private tasExperimentService : ITASExperimentService ,
106
+ @IWorkspaceContextService private workspaceContextService : IWorkspaceContextService ,
108
107
) {
109
108
super ( ) ;
110
109
@@ -166,18 +165,9 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
166
165
return ;
167
166
}
168
167
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 ;
181
171
}
182
172
183
173
this . promptRecommendationsForModel ( model ) ;
0 commit comments