File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/vs/workbench/contrib/chat/browser/tools Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,14 @@ export class UserToolSetsContributions extends Disposable implements IWorkbenchC
178
178
179
179
const store = this . _store . add ( new DisposableStore ( ) ) ;
180
180
181
+ const getFilesInFolder = async ( folder : URI ) => {
182
+ try {
183
+ return ( await this . _fileService . resolve ( folder ) ) . children ?? [ ] ;
184
+ } catch ( err ) {
185
+ return [ ] ; // folder does not exist or cannot be read
186
+ }
187
+ } ;
188
+
181
189
this . _store . add ( autorun ( async r => {
182
190
183
191
store . clear ( ) ;
@@ -190,14 +198,14 @@ export class UserToolSetsContributions extends Disposable implements IWorkbenchC
190
198
const cts = new CancellationTokenSource ( ) ;
191
199
store . add ( toDisposable ( ( ) => cts . dispose ( true ) ) ) ;
192
200
193
- const stat = await this . _fileService . resolve ( uri ) ;
201
+ const entries = await getFilesInFolder ( uri ) ;
194
202
195
203
if ( cts . token . isCancellationRequested ) {
196
204
store . clear ( ) ;
197
205
return ;
198
206
}
199
207
200
- for ( const entry of stat . children ?? [ ] ) {
208
+ for ( const entry of entries ) {
201
209
202
210
if ( ! entry . isFile || ! RawToolSetsShape . isToolSetFileName ( entry . resource ) ) {
203
211
// not interesting
You can’t perform that action at this time.
0 commit comments