From e986ad694958bebefd9248b729e9bf2e3c3c60a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9di-R=C3=A9mi=20Hashim?= Date: Tue, 29 Apr 2025 13:13:21 +0100 Subject: [PATCH 1/2] As part of incremental type checking, when filtering out potentially unwanted parser errors, don't ignore the multiple definitions type error --- server/src/incrementalCompilation.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/src/incrementalCompilation.ts b/server/src/incrementalCompilation.ts index 4bb824556..0ca5e28d5 100644 --- a/server/src/incrementalCompilation.ts +++ b/server/src/incrementalCompilation.ts @@ -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 name ` type error's + // message includes the filepath with LOC of the duplicate definition + d.message.includes("Multiple definition of the") ) ) { hasIgnoredErrorMessages = true; From 7406e823bfb4f01b71414c367061722085cf227a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9di-R=C3=A9mi=20Hashim?= Date: Tue, 29 Apr 2025 13:22:37 +0100 Subject: [PATCH 2/2] Added CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3df13a94f..a6b1dda24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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