Skip to content

Commit

Permalink
Revert "Merge diagnostics from lax process."
Browse files Browse the repository at this point in the history
This reverts commit bb544c3.
  • Loading branch information
gebner committed Jul 1, 2024
1 parent 83ecb57 commit be20652
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-floating-promises': 1,
'no-inner-declarations': 0,
}
};
14 changes: 3 additions & 11 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,17 +403,9 @@ export class DocumentState {
[...this.fstar.results.diagnostics, ...this.fstar.results.outOfBandErrors];

if (this.fstar_lax) {
// Merge diagnostics from the lax process.
// Note: pulse produces *different* diagnostics in the lax process,
// in particular `show_proof_state` might only be available there and not in the full process.
// Therefore we need to merge diagnostics even for fragments
// which have been processed by both the lax and full processes.
function rangeStr(r: Range): string { return `${r.start.line}:${r.start.character}-${r.end.line}:${r.end.character}`; }
const existingRanges = new Set<string>();
for (const diag of this.fstar.results.diagnostics) {
existingRanges.add(rangeStr(diag.range));
}
diags.push(...this.fstar_lax.results.diagnostics.filter(d => !existingRanges.has(rangeStr(d.range))));
// Add diagnostics from the lax position that are after the part processed by the full process.
const lastPos = mkPosition(this.fstar.results.fragments.findLast(f => !f.invalidatedThroughEdits && f.ok !== undefined)?.range?.end || [1, 1]);
diags.push(...this.fstar_lax.results.diagnostics.filter(d => posLe(lastPos, d.range.start)));
}

void this.server.connection.sendDiagnostics({
Expand Down

0 comments on commit be20652

Please sign in to comment.