@@ -48,7 +48,7 @@ ConfigurationConverter configurationConverter
4848 var builder = new ConfigurationBuilder ( )
4949 . Add ( new DidChangeConfigurationSource ( this ) ) ;
5050 configurationBuilderAction ( builder ) ;
51- _configuration = ( builder . Build ( ) as ConfigurationRoot ) ! ;
51+ _configuration = ( builder . Build ( ) as ConfigurationRoot ) ! ;
5252
5353 var triggerChange = new Subject < System . Reactive . Unit > ( ) ;
5454 _compositeDisposable . Add ( triggerChange ) ;
@@ -86,9 +86,16 @@ public Task<Unit> Handle(DidChangeConfigurationParams request, CancellationToken
8686
8787 private IObservable < System . Reactive . Unit > GetWorkspaceConfiguration ( )
8888 {
89- if ( _capability == null || _configurationItems . Count == 0 )
89+ // do not warn if they are not using configuration
90+ if ( _capability == null )
91+ {
92+ return Empty < System . Reactive . Unit > ( ) ;
93+ }
94+
95+ if ( _configurationItems . Count == 0 )
9096 {
9197 _logger . LogWarning ( "No ConfigurationItems have been defined, configuration won't surface any configuration from the client!" ) ;
98+
9299 OnReload ( ) ;
93100 return Empty < System . Reactive . Unit > ( ) ;
94101 }
@@ -113,9 +120,8 @@ public Task<Unit> Handle(DidChangeConfigurationParams request, CancellationToken
113120 }
114121 )
115122 . Do (
116- _ => { } , ( ) => {
117- Data = newData ;
118- }
123+ _ => { } ,
124+ ( ) => Data = newData
119125 )
120126 . Subscribe ( observer ) ;
121127 }
@@ -150,7 +156,8 @@ public Task<Unit> Handle(DidChangeConfigurationParams request, CancellationToken
150156 OnReload ( ) ;
151157 o . OnCompleted ( ) ;
152158 return Disposable . Empty ;
153- } )
159+ }
160+ )
154161 ) ;
155162 }
156163
@@ -217,7 +224,7 @@ public async Task<IScopedConfiguration> GetScopedConfiguration(DocumentUri scope
217224 return EmptyDisposableConfiguration . Instance ;
218225
219226 var data = await GetConfigurationFromClient ( scopes . Select ( z => new ConfigurationItem { Section = z . Section , ScopeUri = scopeUri } ) )
220- . Select ( z => ( z . scope . Section ?? string . Empty , z . settings ) )
227+ . Select ( z => ( z . scope . Section ?? string . Empty , z . settings ) )
221228 . ToArray ( )
222229 . ToTask ( cancellationToken )
223230 . ConfigureAwait ( false ) ;
0 commit comments