LanguageClient#onDidStart

I’ve come around to updating my YAML extension and want to hook up one of the server’s custom LSP extensions. It involves sending a notification to the server that opts-in to this behaviour.

From running the LanguageClient with debug: true it seems that notification is not sent if I send it straight after client.start. The start method is async so I wondered if the notifications might be queued but it seems to be getting lost looking at the LSP logs. It does get sent if I wait a few seconds before sending it.

Instead could there be a client.onDidStart similar to client.onDidEnd which is triggered after the client sends the initialized message or when it is ready to send its own messages? The start method could also return a promise for the initialization too?

To repro this, you can set debug:true in the nova-yaml clientOptions and send the notification in the startLanguageServer method and see if it gets sent or not.

client.sendNotification("yaml/registerCustomSchemaRequest");

Also it seems Nova still doesn’t support onRequest properly which I still would like to use. The value or promise I return isn’t triggering an LSP response to be sent to the server. I can see the request is triggered through console.log-ing.

Also also (sorry) I’d love to see virtual documents in Nova, it’d be great for nova-yaml to be able to show the virtual JSON schema associated with a YAML file and that would be the way to do it.