File tree Expand file tree Collapse file tree 4 files changed +34
-3
lines changed Expand file tree Collapse file tree 4 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
11
11
} from 'lsp-ws-connection' ;
12
12
import { until_ready } from './utils' ;
13
13
14
- interface ILSPOptions extends ILspOptions { }
14
+ interface ILSPOptions extends ILspOptions { }
15
15
16
16
export class LSPConnection extends LspWsConnection {
17
17
protected documentsToOpen : IDocumentInfo [ ] ;
@@ -30,7 +30,13 @@ export class LSPConnection extends LspWsConnection {
30
30
}
31
31
32
32
protected onServerInitialized ( params : lsProtocol . InitializeResult ) {
33
- super . onServerInitialized ( params ) ;
33
+ const settings = {
34
+ "yaml.schemas" : {
35
+ "http://json.schemastore.org/composer" : "/*"
36
+ }
37
+ }
38
+ const initParams = { ...params , settings }
39
+ super . onServerInitialized ( initParams ) ;
34
40
while ( this . documentsToOpen . length ) {
35
41
this . sendOpen ( this . documentsToOpen . pop ( ) ) ;
36
42
}
Original file line number Diff line number Diff line change @@ -148,6 +148,14 @@ export class DocumentConnectionManager {
148
148
return connection ;
149
149
}
150
150
151
+ public updateServerConfigurations (
152
+ options ?: { }
153
+ ) {
154
+ for ( let [ , connection ] of this . connections ) {
155
+ connection . sendConfigurationChange ( options )
156
+ }
157
+ }
158
+
151
159
/**
152
160
* Fired the first time a connection is opened. These _should_ be the only
153
161
* invocation of `.on` (once remaining LSPFeature.connection_handlers are made
Original file line number Diff line number Diff line change @@ -235,13 +235,15 @@ const plugin: JupyterFrontEndPlugin<void> = {
235
235
notebook_command_manager . add ( lsp_commands ) ;
236
236
237
237
function updateOptions ( settings : ISettingRegistry . ISettings ) : void {
238
- // let options = settings.composite;
238
+ const options = settings . composite ;
239
239
// Object.keys(options).forEach((key) => {
240
240
// if (key === 'modifier') {
241
241
// // let modifier = options[key] as KeyModifier;
242
242
// CodeMirrorExtension.modifierKey = modifier;
243
243
// }
244
244
// });
245
+ console . log ( connection_manager )
246
+ connection_manager . updateServerConfigurations ( options )
245
247
}
246
248
247
249
settingRegistry
Original file line number Diff line number Diff line change @@ -268,6 +268,20 @@ export class LspWsConnection extends events.EventEmitter
268
268
) ;
269
269
}
270
270
271
+ public sendConfigurationChange (
272
+ options ?: any
273
+ ) {
274
+ console . log ( `Updated server configuration: ${ JSON . stringify ( options ) } ` )
275
+ if ( ! this . isReady ) {
276
+ return ;
277
+ }
278
+
279
+ this . connection . sendNotification (
280
+ 'workspace/didChangeConfiguration' ,
281
+ options
282
+ )
283
+ }
284
+
271
285
public async getHoverTooltip (
272
286
location : IPosition ,
273
287
documentInfo : IDocumentInfo ,
@@ -605,6 +619,7 @@ export class LspWsConnection extends events.EventEmitter
605
619
}
606
620
607
621
protected onServerInitialized ( params : protocol . InitializeResult ) {
622
+ console . log ( "MODIFIED SERVER INIT 4" , params )
608
623
this . isInitialized = true ;
609
624
this . serverCapabilities = params . capabilities ;
610
625
this . connection . sendNotification ( 'initialized' ) ;
You can’t perform that action at this time.
0 commit comments