Skip to content

Commit

Permalink
vscode-ext: fix flickering view rendering after server restart
Browse files Browse the repository at this point in the history
  • Loading branch information
umutdural committed May 30, 2024
1 parent fa95480 commit 93ea12b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions vscode-ext/src/CaesarClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<LanguageClient | null> {
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 93ea12b

Please sign in to comment.