Skip to content
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 @@ -16,6 +16,8 @@

- Fix: bug where incremental analysis does not work when the project folder contains a dot. https://github.com/rescript-lang/rescript-vscode/pull/1080

- Fix: bug where incremental compilation crashes when rewatch is being run in a specific package vs the root of the monorepo. https://github.com/rescript-lang/rescript-vscode/pull/1082

## 1.62.0

#### :nail_care: Polish
Expand Down
20 changes: 17 additions & 3 deletions server/src/incrementalCompilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,23 @@ function triggerIncrementalCompilationOfFile(
if (debug()) console.log("Did not find open project for " + filePath);
return;
}
const workspaceRootPath = projectRootPath
? utils.findProjectRootOfFile(projectRootPath, true)
: null;

const projectRewatchLockfile = path.resolve(
projectRootPath,
c.rewatchLockPartialPath
);

let foundRewatchLockfileInProjectRoot = false;
if (fs.existsSync(projectRewatchLockfile)) {
foundRewatchLockfileInProjectRoot = true;
}

// if we find a rewatch.lock in the project root, it's a compilation of a local package
// in the workspace.
const workspaceRootPath =
projectRootPath && !foundRewatchLockfileInProjectRoot
? utils.findProjectRootOfFile(projectRootPath, true)
: null;

const bscBinaryLocation = project.bscBinaryLocation;
if (bscBinaryLocation == null) {
Expand Down