提交 ec45a3a5 编写于 作者: M Martin Aeschlimann

[json] wait for onReady before using client

上级 a603e8a7
......@@ -68,6 +68,8 @@ export function activate(context: ExtensionContext) {
// Create the language client and start the client.
let client = new LanguageClient('json', localize('jsonserver.name', 'JSON Language Server'), serverOptions, clientOptions);
let disposable = client.start();
client.onReady().then(() => {
client.onTelemetry(e => {
if (telemetryReporter) {
telemetryReporter.sendTelemetryEvent(e.key, e.data);
......@@ -84,9 +86,8 @@ export function activate(context: ExtensionContext) {
});
});
let disposable = client.start();
client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context));
});
// Push the disposable to the context's subscriptions so that the
// client can be deactivated on extension deactivation
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册