rescript-lang / rescript-lang/rescript-vscode

Compiler is killed when switching between previewed files

Open
#541 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
ReScript
Stars
354
Forks
63
Avg merge
11h 29m
Merged PRs (30d)
1

Description

vscode v1.69.2
rescript-vscode v1.5.11

Reproduce:

  • Open a single file in a project in preview mode (single click in explorer, name is shown in italics in the tab bar)
  • Start a build via the popup
  • Switch to a different file in preview mode
    • This closes the currently previewed file and opens the new file

After starting a build via the popup:

❯ ps aux | grep rescript
bart.sc+  389111  2.5  0.5 21417852 78388 ?      Sl   10:10   0:00 /nix/store/5i1zfmhk46dwl94jfp82lacyi5fk06f5-vscode-1.69.2/lib/vscode/code --ms-enable-electron-run-as-node /home/bart.schuurmans/.vscode/extensions/chenglou92.rescript-vscode/server/out/server.js --node-ipc --clientProcessId=389080
bart.sc+  389337  0.6  0.2 321984 36596 ?        Sl   10:10   0:00 node /home/bart.schuurmans/engineering/lumi/frontend/provisioner/node_modules/.bin/rescript build -w

After switching to a different file in the same project, the compiler is no longer running:

❯ ps aux | grep rescript
bart.sc+  389111  0.5  0.5 21417852 79356 ?      Sl   10:10   0:00 /nix/store/5i1zfmhk46dwl94jfp82lacyi5fk06f5-vscode-1.69.2/lib/vscode/code --ms-enable-electron-run-as-node /home/bart.schuurmans/.vscode/extensions/chenglou92.rescript-vscode/server/out/server.js --node-ipc --clientProcessId=389080

The popup to start a new build is also shown now.

strace of the rescript build -w process during switching:

[pid 389337] --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=389111, si_uid=1000} ---
+++ exited with 0 +++

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the preview-mode file switch while watching the server entry point at server/out/server.js and the rescript build -w process. Trace which file-switch or preview-close event sends SIGTERM, then verify that switching files leaves the build running and does not show the start-build popup.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.