Skip to content

As part of incremental type checking, when filtering out potentially unwanted parser errors, don't ignore the multiple definitions type error #1086

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
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#### :bug: Bug fix

- Fix: bug where we incorrectly showed a warning notification about something going wrong with incremental type checking, when in fact the compiler was reporting multiple definitions of the same type or module name https://github.com/rescript-lang/rescript-vscode/pull/1086

- Fix: incorrect highlighting of `as` inside labelled arguments like `toast` https://github.com/rescript-lang/rescript-vscode/pull/1085

- Fix: bug where incremental analysis does not work when the project folder contains a dot. https://github.com/rescript-lang/rescript-vscode/pull/1080
Expand Down
9 changes: 7 additions & 2 deletions server/src/incrementalCompilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,13 @@ async function compileContents(
.filter((d) => {
if (
!d.message.startsWith("Uninterpreted extension 'rescript.") &&
!d.message.includes(
`/${INCREMENTAL_FOLDER_NAME}/${entry.file.sourceFileName}`
(
!d.message.includes(
`/${INCREMENTAL_FOLDER_NAME}/${entry.file.sourceFileName}`
) ||
// The `Multiple definition of the <kind> name <name>` type error's
// message includes the filepath with LOC of the duplicate definition
d.message.includes("Multiple definition of the")
)
) {
hasIgnoredErrorMessages = true;
Expand Down