File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/files/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export class ExplorerService implements IExplorerService {
4040 private editable : { stat : ExplorerItem , data : IEditableData } | undefined ;
4141 private _sortOrder : SortOrder ;
4242 private cutItems : ExplorerItem [ ] | undefined ;
43+ private fileSystemProviderSchemes = new Set < string > ( ) ;
4344
4445 constructor (
4546 @IFileService private fileService : IFileService ,
@@ -98,7 +99,14 @@ export class ExplorerService implements IExplorerService {
9899 this . disposables . push ( this . fileService . onAfterOperation ( e => this . onFileOperation ( e ) ) ) ;
99100 this . disposables . push ( this . fileService . onFileChanges ( e => this . onFileChanges ( e ) ) ) ;
100101 this . disposables . push ( this . configurationService . onDidChangeConfiguration ( e => this . onConfigurationUpdated ( this . configurationService . getValue < IFilesConfiguration > ( ) ) ) ) ;
101- this . disposables . push ( this . fileService . onDidChangeFileSystemProviderRegistrations ( ( ) => this . _onDidChangeItem . fire ( undefined ) ) ) ;
102+ this . disposables . push ( this . fileService . onDidChangeFileSystemProviderRegistrations ( e => {
103+ if ( e . added && this . fileSystemProviderSchemes . has ( e . scheme ) ) {
104+ // A file system provider got re-registered, we should update all file stats since they might change (got read-only)
105+ this . _onDidChangeItem . fire ( undefined ) ;
106+ } else {
107+ this . fileSystemProviderSchemes . add ( e . scheme ) ;
108+ }
109+ } ) ) ;
102110 this . disposables . push ( model . onDidChangeRoots ( ( ) => this . _onDidChangeRoots . fire ( ) ) ) ;
103111
104112 return model ;
You can’t perform that action at this time.
0 commit comments