Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Reason/OCaml autocompletes or hovers #1946

Closed
jplew opened this issue Jun 16, 2020 · 3 comments
Closed

No Reason/OCaml autocompletes or hovers #1946

jplew opened this issue Jun 16, 2020 · 3 comments
Labels
A-language-support Area: Language support, syntax highlighting, language server etc. bug Something isn't working

Comments

@jplew
Copy link

jplew commented Jun 16, 2020

Hello,
it seems my Reason language support is not working. I am getting useful autocomplete suggestions and mouse hovers when editing js and ts files, but have no such support for ml or re files. For example, when I type Console.l, nothing happens.

The reason-vscode plugin appears to be loading fine:
image

In contrast, autocompletion works fine in VS Code (with the reason-vscode plugin installed), when I open the same Reason project there.

I tried using my own reason-language-server and linking it manually in the configuration.json (following these instructions: https://github.com/jaredly/reason-language-server#onivim), but no dice:

"language.reason.languageServer.command": "/usr/local/bin/reason-language-server",

I'm using the the latest build (#86aa3de7) on Mac OS 10.15.5.

@bryphe bryphe added A-language-support Area: Language support, syntax highlighting, language server etc. bug Something isn't working labels Jun 18, 2020
@bryphe
Copy link
Member

bryphe commented Jun 18, 2020

Hi @jplew ,

Thanks for logging the issue!

What kind of project is this - is it a bucklescript project (ie, using bsb) or a reason native project (ie, using esy)? Is it an open source project that I can try and reproduce on?

One common issue is not having the sources built - but the fact that it is working in VSCode but not in Onivim rules this out.

@jplew
Copy link
Author

jplew commented Jun 18, 2020

I experience this problem in both types of projects.

It fails for git clone https://github.com/esy-ocaml/hello-reason.git and bsb -init my-new-project -theme basic-reason.

Now that I think about it, the problem is probably not in Onivim. I suspect the problem lies in the reason-vscode extension, related to this issue: jaredly/reason-language-server#248

The reason being, the extension actually fails in VS Code (occasionally, with certain kinds of projects) with this error: Could not run compiler (ran /Users/jplew/.opam/4.09.0/bin/ocamlopt.opt -version).

That ocamlopt.opt does not exist at that location. Since I used Homebrew to install opam, the compiler lives here: /usr/local/Cellar/ocaml/4.09.0/bin/ocamlopt.opt.

If you agree I'll close this and file the bug there.

@bryphe
Copy link
Member

bryphe commented Jun 19, 2020

Thanks for the update @jplew !

Now that I think about it, the problem is probably not in Onivim. I suspect the problem lies in the reason-vscode extension, related to this issue: jaredly/reason-language-server#248

Interesting... I've had good luck with ocaml-lsp in both types of projects. It's a bit pain to set up for bucklescript (but doable with these steps)

If you agree I'll close this and file the bug there.

Sure! I started drafting up some documentation on setting up ReasonML/OCaml/BuckleScript integration here:
https://github.com/onivim/oni2/blob/master/docs/docs/languages/reason-ocaml.md

Will close this, but let me know if you have any feedback on the docs 👍

@bryphe bryphe closed this as completed Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Language support, syntax highlighting, language server etc. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants