Skip to content

Commit 4d3c059

Browse files
committed
Don't crash when compiler.log contains OCaml warnings.
1 parent a4e40e7 commit 4d3c059

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## master
22
- Fix issue with highlighting of templates introduced in release 1.2.0.
3+
- Fix crash when the project contains OCaml files that have warnings.
34

45
## 1.2.0
56

server/src/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,13 @@ export let parseCompilerLogOutput = (
440440
// do nothing for now
441441
} else if (line.startsWith("#Done(")) {
442442
done = true;
443+
} else if (
444+
line.startsWith("File ") &&
445+
i + 1 < lines.length &&
446+
lines[i + 1].startsWith("Warning ")
447+
) {
448+
// OCaml warning: skip
449+
i++;
443450
} else if (/^ +([0-9]+| +|\.) (|)/.test(line)) {
444451
// ^^ indent
445452
// ^^^^^^^^^^^^^^^ gutter

0 commit comments

Comments
 (0)