@@ -8,7 +8,6 @@ import { sleep, until_ready } from './utils';
8
8
// Name-only import so as to not trigger inclusion in main bundle
9
9
import * as ConnectionModuleType from './connection' ;
10
10
import { TLanguageServerId , ILanguageServerManager } from './tokens' ;
11
- import { ClientConfigurationSchema } from './_schema'
12
11
13
12
export interface IDocumentConnectionData {
14
13
virtual_document : VirtualDocument ;
@@ -131,7 +130,7 @@ export class DocumentConnectionManager {
131
130
const language_server_id = this . language_server_manager . getServerId ( {
132
131
language
133
132
} ) ;
134
-
133
+ console . log ( "LS ID: " , language_server_id )
135
134
// lazily load 1) the underlying library (1.5mb) and/or 2) a live WebSocket-
136
135
// like connection: either already connected or potentiailly in the process
137
136
// of connecting.
@@ -151,15 +150,12 @@ export class DocumentConnectionManager {
151
150
152
151
public async updateServerConfigurations (
153
152
//TODO: define types for server configurations
154
- options : any
153
+ settings : any
155
154
) {
156
- for ( let language in options ) {
157
- let connection = this . connections . get ( language )
158
-
159
- if ( connection ) {
160
- const config = options [ language ] . config
161
- await connection . sendConfigurationChange ( config )
162
- }
155
+ console . log ( this . language_server_manager )
156
+ for ( let language_server_id in settings ) {
157
+ const config = settings [ language_server_id ] . config
158
+ await Private . updateServerConfiguration ( language_server_id , config )
163
159
}
164
160
}
165
161
@@ -263,7 +259,6 @@ export class DocumentConnectionManager {
263
259
}
264
260
}
265
261
266
- // Travis: per language configuration here?
267
262
async connect ( options : ISocketConnectionOptions ) {
268
263
console . log ( 'LSP: connection requested' , options ) ;
269
264
let connection = await this . connect_socket ( options ) ;
@@ -389,4 +384,14 @@ namespace Private {
389
384
390
385
return connection ;
391
386
}
387
+
388
+ export async function updateServerConfiguration (
389
+ language_server_id : any ,
390
+ settings : any
391
+ ) : Promise < any > {
392
+ const connection = _connections . get ( language_server_id )
393
+ if ( connection ) {
394
+ await connection . sendConfigurationChange ( settings )
395
+ }
396
+ }
392
397
}
0 commit comments