@@ -48,7 +48,7 @@ ConfigurationConverter configurationConverter
48
48
var builder = new ConfigurationBuilder ( )
49
49
. Add ( new DidChangeConfigurationSource ( this ) ) ;
50
50
configurationBuilderAction ( builder ) ;
51
- _configuration = ( builder . Build ( ) as ConfigurationRoot ) ! ;
51
+ _configuration = ( builder . Build ( ) as ConfigurationRoot ) ! ;
52
52
53
53
var triggerChange = new Subject < System . Reactive . Unit > ( ) ;
54
54
_compositeDisposable . Add ( triggerChange ) ;
@@ -86,9 +86,16 @@ public Task<Unit> Handle(DidChangeConfigurationParams request, CancellationToken
86
86
87
87
private IObservable < System . Reactive . Unit > GetWorkspaceConfiguration ( )
88
88
{
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 )
90
96
{
91
97
_logger . LogWarning ( "No ConfigurationItems have been defined, configuration won't surface any configuration from the client!" ) ;
98
+
92
99
OnReload ( ) ;
93
100
return Empty < System . Reactive . Unit > ( ) ;
94
101
}
@@ -113,9 +120,8 @@ public Task<Unit> Handle(DidChangeConfigurationParams request, CancellationToken
113
120
}
114
121
)
115
122
. Do (
116
- _ => { } , ( ) => {
117
- Data = newData ;
118
- }
123
+ _ => { } ,
124
+ ( ) => Data = newData
119
125
)
120
126
. Subscribe ( observer ) ;
121
127
}
@@ -150,7 +156,8 @@ public Task<Unit> Handle(DidChangeConfigurationParams request, CancellationToken
150
156
OnReload ( ) ;
151
157
o . OnCompleted ( ) ;
152
158
return Disposable . Empty ;
153
- } )
159
+ }
160
+ )
154
161
) ;
155
162
}
156
163
@@ -217,7 +224,7 @@ public async Task<IScopedConfiguration> GetScopedConfiguration(DocumentUri scope
217
224
return EmptyDisposableConfiguration . Instance ;
218
225
219
226
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 ) )
221
228
. ToArray ( )
222
229
. ToTask ( cancellationToken )
223
230
. ConfigureAwait ( false ) ;
0 commit comments