ocaml-multicore / multicore-opam

OPAM repo for OCaml multicore development
MIT License
53 stars 21 forks source link

multicore domains+effects language server does not work with VS Code #60

Open onsah opened 3 years ago

onsah commented 3 years ago

I have installed the multicore switch as doucmented. But when I hover over a variable in an ocaml file language server outputs the following error:

[Error - 1:40:25 PM] Request textDocument/hover failed.
Error: Connection got disposed.
    at Object.dispose (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:29:7304)
    at Object.dispose (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:34:13700)
    at LanguageClient.handleConnectionClosed (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:36:12025)
    at LanguageClient.handleConnectionClosed (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:39:18193)
    at closeHandler (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:36:11626)
    at CallbackList.invoke (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:2:14539)
    at Emitter.fire (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:2:15449)
    at closeHandler (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:3:16191)
    at CallbackList.invoke (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:2:14539)
    at Emitter.fire (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:2:15449)
    at StreamMessageReader.fireClose (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:2:18493)
    at Socket.<anonymous> (/home/myhome/.vscode/extensions/ocamllabs.ocaml-platform-1.8.4/dist/vscode_ocaml_platform.bc.js:2:20843)
    at Socket.emit (events.js:327:22)
    at Pipe.<anonymous> (net.js:673:12)
[Info  - 1:40:26 PM] Connection to server got closed. Server will restart.

I am currently on 4.12.0+domains+effect switch

prekel commented 3 years ago

ocaml-lsp-server.1.4.0+effects depends on "ocaml" {>= "4.06" & < "4.12"} and merlin.3.4.1+effects depends on "ocaml" {>= "4.02.1" & < "4.12"} which is less than 4.12. I guess that because of this you have these packages from default repository, without effects syntax support. And I guess that there a misinformation in README.md#install-ocaml-lsp-and-merlin because opam install dune merlin ocaml-lsp-server installs merlin and lsp from default.

onsah commented 3 years ago

@prekel So is it impossible get language server support for effects? Can I get by using 4.10.0+multicore ? I tried to install 4.10.0+multicore switch but got an error about base-effects requiring at least 4.12.0. I just want to try out the effects in Ocaml. How can I install it with language server support on my machine?

prekel commented 3 years ago

Sorry that not mention that immediately, but before I found that issue, I tried to try effects too and got the same issue. And I asked @EduardoRFS (because he participated in #39) on his twitch stream. He answered that porting requires work, if I understood everything correctly.

To one who will return effects syntax support, will need @mattpallissard's developments described in https://github.com/ocaml-multicore/multicore-opam/pull/40#issuecomment-756266723

Btw, there is opened issue in merlin repository https://github.com/ocaml/merlin/issues/1197

mattpallissard commented 3 years ago

The way Merlin compiles requires a patch set for every version of Ocaml. It's more or less a three way diff between the Ocaml files, the Ocaml files for N-1 and the Merlin files for N-1.

I can probably find the time to cobble together a patch set at some point in the next week or so.

prekel commented 3 years ago

According to the latest Multicore report and https://github.com/ocaml-multicore/ocaml-multicore/pull/651/, effects is available in 4.12+domains without syntactic support. @onsah you can try effects by following examples behind report or test files in pr