Skip to content

Support the ReScript 13 flat build layout - #1195

Open
fhammerschmidt wants to merge 4 commits into
masterfrom
resi/v13-flat-build-layout
Open

fhammerschmidt wants to merge 4 commits into
masterfrom
resi/v13-flat-build-layout

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Fixes #1194.

Changes

  • Teach the stable extension and language server to find diagnostics, build metadata, compiler artifacts, and the watch lock in lib/rescript. Keep the prior layout for v12 and earlier v13 previews.
  • Use the flat scratch directory and compiler working directory for incremental type checking, and handle v13 interface generation. No changes to the experimental OCaml LSP.

Testing

  • Built and bundled the extension on Linux. Ran the bundled language server against ReScript 12.3.1 and the flat-layout compiler preview.
  • Both passed watch startup, saved and unsaved diagnostics, interface generation, local and stdlib go-to-definition, and unsaved completions (Helper.va → value, String.len → length).
  • Desktop VS Code smoke test on macOS with the CI-built VSIX: with a compiler snapshot from master and build output in lib/rescript, typing "lol".len suggested ->String.length with the string => int signature and documentation. The same VSIX also showed String.length autocomplete on alpha.7 with the legacy lib/bs layout.

@fhammerschmidt
fhammerschmidt marked this pull request as ready for review December 3, 2026 17:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T17:35:36.687725Z d96ceb7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d96ceb7628

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread server/src/utils.ts
Comment on lines +729 to +730
lock.endsWith("/watch.lock")
? fs.readFileSync(lockFilePath, "utf8").trim() === String(proc.pid)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clean up watch locks owned by the wrapper's child process

For legacy-layout compilers that use lib/watch.lock, such as ReScript 12.3.1, startBuildWatcher still launches the JavaScript wrapper rather than the native compiler. The lock therefore contains the native child's PID, not proc.pid, so this comparison prevents cleanup after the process group is terminated. Since openedFile now treats this lock's existence as evidence of a running watcher, reopening the project suppresses the start-build prompt even though no watcher is running, leaving saved diagnostics stale. Track the actual lock-owning child or launch the native compiler for these versions too, while retaining the protection against deleting another watcher's lock.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support the flat lib/rescript build layout of ReScript v13

1 participant