Hey everyone!
Today we finally released the long pending changes to our VSCode & Vim plugin to properly support “monorepo setups” (the one where you have a bunch of different ReScript projects put into subfolders, like in yarn workspaces).
How it works:
Our plugins will automatically detect the correct node_modules/bs-platform
path for each reformat / build call to prevent stale binary paths. We stopped using the concepts of “project scopes”, instead, we treat any file independently and look for the nearest binary / project context on demand to ensure correctness.
It was quite complex finding the right heuristics on the tooling detection, since there are multiple definitions on what a monorepo is depending on the tools you use, or how your company defines a monorepo (e.g FB would define a monorepo as one single bsconfig file for everything). Also it was quite tricky understanding how we could ensure that we are not unintentionally picking up the wrong bs-platform folder (in cases where you have mixed versions in multiple subpackages).
As far as we could test it, the setup works really well, but please let us know if you have any edge-cases (with at least a minimal reproducible repo example so we can troubleshoot it).
Other notable changes
rescript-vscode 1.0.4 + LSP
- Some diagnostics watcher staleness fix.
- Various type hover fixes.
Vim 1.2.0
- Upgraded the vendored LSP to 1.4.0 to reflect the newest LSP changes
- Also updated the plain-vim tool detection to work with monorepos (e.g. so you can use
bsc -format
, or just run:RescriptBuild
without the need of a lsp setup) - Added a
:RescriptBuildWorld
and:RescriptCleanWorld
for quick clean builds without leaving the editor - Small bugfixes that were fixed along the way
See the full Changelog for detailed infos.
Installation
VSCode:
Use the plugin manager to install the rescript-vscode
extension to 1.0.4
VIM:
Update and source your vimrc
:
Plug 'rescript-lang/vim-rescript', {'tag': 'v1.2.0'}
and run :PlugUpdate
Please let us know if you find any issues.
We hope you like the changes!