You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have N warnings in the app. I run rescript watch - it shows all of them and editor integration shows all of them as well. Then I save some file in the editor, and all of the warnings disappear from diagnostics.
This is what I see in the console:
After each consequent save, compiler stops outputting warnings - I guess it's related to the reason they disappear from editor diagnostics?
Also, two kinda unrelated remarks:
Feedback time - from save to update - noticeably increased compared to v11. Is this expected or is it something with my setup?
Seems like if I have 3 packages in a workspace, each package has own namespace in editor integration? With Rewatch, I hoped to get workspace wide diagnostics as it's done in rust-analyzer, but apparently it's not how it works in ReScript LSP?
Could you share some more details, at first glance I don't have these problems.
N warnings stay visible on edits in watch mode and my editor keeps highlighting them.
I assume so, but do you have latest rescript npm package? Are you on prerelease editor tooling?
What is LSP client? Operating system?
I can't say much about that, never used v11.
ReScript LSP will only capture diagnostics for any open files. I suppose this is somewhat historically, unfortunately the LSP server does not have the same context as rescript watch has. Nor do they communicate.
Thanks, this is helpful! I can't explain all of it but you see the 9 error of the package after the initial build and I believe rewatch will only show you the warnings of the changed files in subsequent entries.
The same might be true for the editor warnings, initially these probably come from the .compiler.log file and we read all of them. Subsequently, we only take them from the open files into account and most likely clean up those of non-open files.
I haven't fact checked this yet, but that is my current train of thought.
ReScript LSP will only capture diagnostics for any open files
I guess it's partially explains what's happening. Yesterday, I didn't have any files with warnings opened in the editor, so 3 consecutive saves gave me zero warnings in the editor diagnostics. Today, I had some buffers with warnings opened, and it resulted in 4/7 reported warnings after double-save dance.
This works on current master. With @cknitt's minimal repro (an unused x in A.res), saving an unrelated B.res in rescript watch prints the warning for A.res again after the rebuild, and lib/bs/.compiler.log still contains it, so editor diagnostics keep it as well. See #8216, #8358 and #8408.
The other points (the language server only reporting diagnostics for open files, and workspace-wide diagnostics) are about the editor tooling. Please open an issue in rescript-vscode if they are still relevant. Closing.
Activity
nojaf commentedon Jan 8, 2026
Could you share some more details, at first glance I don't have these problems.
N warnings stay visible on edits in watch mode and my editor keeps highlighting them.
I assume so, but do you have latest rescript npm package? Are you on prerelease editor tooling?
What is LSP client? Operating system?
rescript watchhas. Nor do they communicate.alex35mil commentedon Jan 8, 2026
Sure, I recorded video illustrating the issue - things are quite racy.
Context:
Quick rundown:
rescript clean && rescript watch-> all warnings from 1 app appear: 1/9 (1 in the current file, 9 total in the current package)FWIW there are around 90 warnings across the workspace - sometimes editor can show all of them, but it's rare.
CleanShot.2026-01-08.at.11.46.51.mp4
nojaf commentedon Jan 8, 2026
Thanks, this is helpful! I can't explain all of it but you see the 9 error of the package after the initial build and I believe rewatch will only show you the warnings of the changed files in subsequent entries.
The same might be true for the editor warnings, initially these probably come from the
.compiler.logfile and we read all of them. Subsequently, we only take them from the open files into account and most likely clean up those of non-open files.I haven't fact checked this yet, but that is my current train of thought.
alex35mil commentedon Jan 8, 2026
I guess it's partially explains what's happening. Yesterday, I didn't have any files with warnings opened in the editor, so 3 consecutive saves gave me zero warnings in the editor diagnostics. Today, I had some buffers with warnings opened, and it resulted in 4/7 reported warnings after double-save dance.
dkirchhof commentedon Jan 19, 2026
Is it a monorepo?
I observed that editing files of a package generated only warnings of this one - not of all packages.
cknitt commentedon Jan 23, 2026
Easy to reproduce even without monorepo:
Let's say I have
A.resandA.resiwith some unused variable warning inA.res.When re-saving
A.res, this unused variable warning still shows up.When saving a different file
B.res, the warning disappears.nojaf commentedon Jan 23, 2026
Is there a link between A and B in your example?
cknitt commentedon Jan 23, 2026
No
cristianoc commentedon Jan 23, 2026
do you need both
.resand.resito exist to repro?cknitt commentedon Jan 23, 2026
Actually no, I should have been clearer on that. Just had the .resi because I wanted something unused (unexported) at the top level of the module.
This works just as well to reproduce without .resi (unused
x):cknitt commentedon Oct 19, 2026
This works on current master. With @cknitt's minimal repro (an unused
xinA.res), saving an unrelatedB.resinrescript watchprints the warning forA.resagain after the rebuild, andlib/bs/.compiler.logstill contains it, so editor diagnostics keep it as well. See #8216, #8358 and #8408.The other points (the language server only reporting diagnostics for open files, and workspace-wide diagnostics) are about the editor tooling. Please open an issue in rescript-vscode if they are still relevant. Closing.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kr4cjoUi2f5VpMvE6wT9bo