Adding LSP to try-rescript playground?

I am a big fan of the auto completion at Try Eio

If possible, I would like to add it to https://rescript-lang.org/try

This seems to involve two steps:

  1. configuring codemirror to add auto completion support (try-eio already has code for this)

  2. running LSP server for rescript in a webworker

I would like to focus this port on #2.

===

I believe the relevant code is at :

There seems to be three approaches to this:

  1. build this code via jsoo (easiest?)

  2. compile this code to wasm (not sure if ocaml can target wasm)

  3. try to build this code in rescript (not sure about compilerlibs406 dependency in dune)

I am interested in hearing the advice / thoughts of those more skilled than me in this. In particular, how much of that dune file do we need ? Is this LSP using compilerlibs406 to parse *.res files ? If not, can we rip that dependency out ?

Thanks!