diff --git a/vscode-ext/src/CaesarClient.ts b/vscode-ext/src/CaesarClient.ts index a0e8013b..e84476a0 100644 --- a/vscode-ext/src/CaesarClient.ts +++ b/vscode-ext/src/CaesarClient.ts @@ -113,6 +113,17 @@ export class CaesarClient { this.needsRestart = true; } })); + + // listen to onDidSaveTextDocument events + const autoVerify: string = CaesarConfig.get(ConfigurationConstants.automaticVerification); + if (autoVerify === "onsave") { + context.subscriptions.push(vscode.workspace.onDidSaveTextDocument((document) => { + if (document.languageId !== "heyvl") { + return; + } + void this.verify(document); + })); + } } private async createClient(recommendInstallation: boolean): Promise { @@ -171,16 +182,7 @@ export class CaesarClient { } })); - // listen to onDidSaveTextDocument events - const autoVerify: string = CaesarConfig.get(ConfigurationConstants.automaticVerification); - if (autoVerify === "onsave") { - context.subscriptions.push(vscode.workspace.onDidSaveTextDocument((document) => { - if (document.languageId !== "heyvl") { - return; - } - void this.verify(document); - })); - } + // check server version context.subscriptions.push(client.onNotification("custom/caesarReady", (event) => {