@@ -9,7 +9,7 @@ import { Event, Emitter } from 'vs/base/common/event';
99import * as errors from 'vs/base/common/errors' ;
1010import { Disposable , IDisposable , dispose , toDisposable } from 'vs/base/common/lifecycle' ;
1111import { RunOnceScheduler } from 'vs/base/common/async' ;
12- import { FileChangeType , FileChangesEvent , IFileService } from 'vs/platform/files/common/files' ;
12+ import { FileChangeType , FileChangesEvent , IFileService , whenProviderRegistered } from 'vs/platform/files/common/files' ;
1313import { ConfigurationModel , ConfigurationModelParser } from 'vs/platform/configuration/common/configurationModels' ;
1414import { WorkspaceConfigurationModelParser , StandaloneConfigurationModelParser } from 'vs/workbench/services/configuration/common/configurationModels' ;
1515import { FOLDER_SETTINGS_PATH , TASKS_CONFIGURATION_KEY , FOLDER_SETTINGS_NAME , LAUNCH_CONFIGURATION_KEY , IConfigurationCache , ConfigurationKey , REMOTE_MACHINE_SCOPES , FOLDER_SCOPES , WORKSPACE_SCOPES } from 'vs/workbench/services/configuration/common/configuration' ;
@@ -24,20 +24,6 @@ import { IConfigurationModel } from 'vs/platform/configuration/common/configurat
2424import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
2525import { hash } from 'vs/base/common/hash' ;
2626
27- function whenProviderRegistered ( scheme : string , fileService : IFileService ) : Promise < void > {
28- if ( fileService . canHandleResource ( URI . from ( { scheme } ) ) ) {
29- return Promise . resolve ( ) ;
30- }
31- return new Promise ( ( c , e ) => {
32- const disposable = fileService . onDidChangeFileSystemProviderRegistrations ( e => {
33- if ( e . scheme === scheme && e . added ) {
34- disposable . dispose ( ) ;
35- c ( ) ;
36- }
37- } ) ;
38- } ) ;
39- }
40-
4127export class UserConfiguration extends Disposable {
4228
4329 private readonly parser : ConfigurationModelParser ;
@@ -353,7 +339,7 @@ export class WorkspaceConfiguration extends Disposable {
353339 }
354340
355341 private async waitAndSwitch ( workspaceIdentifier : IWorkspaceIdentifier ) : Promise < void > {
356- await whenProviderRegistered ( workspaceIdentifier . configPath . scheme , this . _fileService ) ;
342+ await whenProviderRegistered ( workspaceIdentifier . configPath , this . _fileService ) ;
357343 if ( ! ( this . _workspaceConfiguration instanceof FileServiceBasedWorkspaceConfiguration ) ) {
358344 const fileServiceBasedWorkspaceConfiguration = this . _register ( new FileServiceBasedWorkspaceConfiguration ( this . _fileService ) ) ;
359345 await fileServiceBasedWorkspaceConfiguration . load ( workspaceIdentifier ) ;
@@ -750,7 +736,7 @@ export class FolderConfiguration extends Disposable implements IFolderConfigurat
750736 if ( workspaceFolder . uri . scheme === Schemas . file ) {
751737 this . folderConfiguration = new FileServiceBasedFolderConfiguration ( this . configurationFolder , this . workbenchState , fileService ) ;
752738 } else {
753- whenProviderRegistered ( workspaceFolder . uri . scheme , fileService )
739+ whenProviderRegistered ( workspaceFolder . uri , fileService )
754740 . then ( ( ) => {
755741 this . folderConfiguration . dispose ( ) ;
756742 this . folderConfigurationDisposable . dispose ( ) ;
0 commit comments