Skip to content

Commit

Permalink
[vscode] Work around "Duplicate symbol".
Browse files Browse the repository at this point in the history
  • Loading branch information
pfusik committed Mar 26, 2024
1 parent 6553c30 commit 58f9e14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions editors/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { FuParser, FuProgram, FuSystem, FuSema, FuSemaHost } from "./fucheck.js"

class VsCodeHost extends FuSemaHost
{
#mutex = false;
#system = FuSystem.new();
#diagnostics: Record<string, vscode.Diagnostic[]> = {};
#hasErrors = false;
Expand All @@ -48,6 +49,9 @@ class VsCodeHost extends FuSemaHost

async #process(document: vscode.TextDocument, parser: FuParser): Promise<void>
{
if (this.#mutex)
return;
this.#mutex = true;
const files = await vscode.workspace.findFiles("*.fu");
this.#diagnostics = {};
this.#hasErrors = false;
Expand All @@ -74,6 +78,7 @@ class VsCodeHost extends FuSemaHost
sema.setHost(this);
sema.process();
}
this.#mutex = false;
}

async updateDiagnostics(document: vscode.TextDocument, diagnosticCollection: vscode.DiagnosticCollection): Promise<void>
Expand Down

0 comments on commit 58f9e14

Please sign in to comment.