Skip to content

Commit

Permalink
Merge pull request #27 from umutdural/vscode-ext
Browse files Browse the repository at this point in the history
vscode-ext: fix flickering view rendering after server restart
  • Loading branch information
Philipp15b authored Jun 4, 2024
2 parents d089b90 + bd6f005 commit f617f01
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions vscode-ext/src/CaesarClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ export class CaesarClient {
this.needsRestart = true;
}
}));

// listen to onDidSaveTextDocument events
this.context.subscriptions.push(vscode.workspace.onDidSaveTextDocument((document) => {
if (document.languageId !== "heyvl" && CaesarConfig.get(ConfigurationConstants.automaticVerification) !== "onsave") {
return;
}
void this.verify(document);
}));

}

private async createClient(recommendInstallation: boolean): Promise<LanguageClient | null> {
Expand Down Expand Up @@ -171,16 +180,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 f617f01

Please sign in to comment.