Skip to content

Commit 0dbf2eb

Browse files
committed
Fix diagnostics code frame parsing
Fixes #86 This took several diffs, one in the compiler codebase to upgrade the code frame display, one in the compiler's ocaml to fix some warning indentation, and one here.
1 parent 951e285 commit 0dbf2eb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

server/src/utils.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,15 @@ export let parseCompilerLogOutput = (
314314
});
315315
} else if (line.startsWith("#Done(")) {
316316
done = true;
317-
} else if (/^ +[0-9]+ /.test(line)) {
318-
// code display. Swallow
317+
} else if (/^ +([0-9]+| +|\.) (|)/.test(line)) {
318+
// ^^ indent
319+
// ^^^^^^^^^^^^^^^ gutter
320+
// ^^^^^ separator
321+
// swallow code display. Examples:
322+
// 10 │
323+
// . │
324+
// │
325+
// 10 ┆
319326
} else if (line.startsWith(" ")) {
320327
parsedDiagnostics[parsedDiagnostics.length - 1].content.push(line);
321328
}

0 commit comments

Comments
 (0)