Skip to content

Don't crash when the file has a self cycle. #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Fixes:
- Fix issue in record field autocomplete not working with type aliases.
- Fix issue where autocomplete for local values would not work in the presence of `@react.component` annotations.
- Fix issue where the server would crash on large output produced by the binary command.
- Fix issue where the server would crash when a file has a self cycle.

## 1.1.3

Expand Down
8 changes: 8 additions & 0 deletions server/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,14 @@ export let parseCompilerLogOutput = (
tag: undefined,
content: [],
});
} else if (line.startsWith("FAILED:")) {
// File with a self cycle
parsedDiagnostics.push({
code: undefined,
severity: t.DiagnosticSeverity.Error,
tag: undefined,
content: [line],
});
} else if (line.startsWith(" Warning number ")) {
let warningNumber = parseInt(line.slice(" Warning number ".length));
let tag: t.DiagnosticTag | undefined = undefined;
Expand Down