[ANN] rescript-vscode 1.0.4 and vim-rescript 1.2.0 relased

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!

14 Likes

For some reason, only version 1.0.2 is visible from within my VSCode, and there isn’t a way to upgrade to 1.0.4.

Does anybody know what is going on, or how to fix this problem?

When I click on “Install Another Version” on the plugin page in VSCode, version 1.0.2 is the only version that is available.

I don’t seem to have any problem with other extensions.

Interesting. It didn’t show automatically to me either. But it was visible in the list of another versions. Maybe I restarted VSCode before or something.

I have restarted VSCode several times, but that didn’t help. I also have reinstalled the extension completely (via VSCode, and by deleting the extension directory, as recommended elsewhere), but that didn’t work either.

Very strange.

Just in case someone has the same problem as me: I had the open source build of Visual Studio Code installed, not the official binary. After I switched to the official binary (which wiped all my settings and plugins), I was able to install version 1.0.4 of this plugin. Maybe wiping all setting and plugins of the open source build also would have worked.