Support for running from a web worker
Dear ocaml-lsp devs,
I am interested in running ocaml-lsp from a web-worker ; would support for that be welcomed?
Hi,
First, I wonder where such desire comes from. (If you'd like it to run in a web-worker to use with vscode.dev, then I would start with making the extension available on the web first. There's been some prior work: https://github.com/ocamllabs/vscode-ocaml-platform/pull/962)
Second, olsp depends on file system and spawning processes system features, how'd you like to address those needs in the context of a web worker? (I know @voodoos did some work on making merlin web-compatible; I have no idea how that works though, given it needs to read cmi's from the fs (?))
Hi Emilio ! I indeed have a prototype of Merlin working in the browser ! It is actually already enabled in the official playground: https://ocaml.org/play I use a web worker that runs a version of Merlin built with js_of_ocaml and a set of plugins written for the Code Mirror editor. CMIs for the stdlib are embedded in the javascript code and loaded via js_of_ocaml pseudo file system.
It is still a bit rough around the edges but quite satisfying to use already :-)
I would be happy to help you using it !