Skip to content

Commit dc871ba

Browse files
committed
Don't crash when the file has a self cycle.
When there's a self cycle, the compiler.log gives an (out-of-spec) error of the form: ``` FAILED: Tst has a self cycle ``` Notice the compiler is silent when the cycle involves more than one file (the terminal shows an error, but compiler.log is empty).
1 parent 5dd2fa1 commit dc871ba

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Fixes:
1818
- Fix issue in record field autocomplete not working with type aliases.
1919
- Fix issue where autocomplete for local values would not work in the presence of `@react.component` annotations.
2020
- Fix issue where the server would crash on large output produced by the binary command.
21+
- Fix issue where the server would crash when a file has a self cycle.
2122

2223
## 1.1.3
2324

server/src/utils.ts

+8
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,14 @@ export let parseCompilerLogOutput = (
389389
tag: undefined,
390390
content: [],
391391
});
392+
} else if (line.startsWith("FAILED:")) {
393+
// File with a self cycle
394+
parsedDiagnostics.push({
395+
code: undefined,
396+
severity: t.DiagnosticSeverity.Error,
397+
tag: undefined,
398+
content: [line],
399+
});
392400
} else if (line.startsWith(" Warning number ")) {
393401
let warningNumber = parseInt(line.slice(" Warning number ".length));
394402
let tag: t.DiagnosticTag | undefined = undefined;

0 commit comments

Comments
 (0)