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

Merlin fails only on VS Code #78

Open
AntouanK opened this issue Jan 25, 2017 · 7 comments
Open

Merlin fails only on VS Code #78

AntouanK opened this issue Jan 25, 2017 · 7 comments

Comments

@AntouanK
Copy link

Started using bucklescript yesterday, and the ocaml plugin in VSCode has a weird behaviour.
Initially, when I got merlin, autocomplete worked fine. Once I started working on examples on bucklescript, I noticed merlin didn't work anymore.
I checked it with vim, and I had problems there as well, but they were fixed.
ocaml/merlin#617
So right now, merlin in vim works perfectly.
Also, I checked that ocamlmerlin and ocp-indent are available in the PATH and they work as expected.
Still, in VSCode merlin doesn't work at all.

Any help on how to debug this?

Thank you.

@AntouanK
Copy link
Author

Seems like the problem is that I use zsh as my main shell, and my PATH is defined in .zshrc.
If I launch VSCode manually from a zsh shell, merlin works.

So where can I put PATH so that VSCode can read it?

@hackwaly
Copy link
Owner

You can open the developer tool of vscode, and then check process.env on the console to see what env vscode recognised

@hackwaly
Copy link
Owner

You can use opam setup the shell init script. I remember it works

@AntouanK
Copy link
Author

Interesting...
Seems like the shell is correct, but the environment variables are entirely different.

Opening VS Code normally
screen shot 2017-01-25 at 15 03 15

Opening VS Code from a zsh session ( with open -a "Visual Studio Code" )
screen shot 2017-01-25 at 15 03 47

@eimpec
Copy link

eimpec commented Jan 25, 2017

I have somewhat similar issue with merlin failing on VSCode. It fails only with the file which uses js_of_ocaml ## syntax. When I start hovering the mouse over expressions, after few successful attempts the hover modal just starts showing "Loading..." and the CPU usage of merlin jumps to 100% until the process is killed. Other files seems to be working just fine.
See the merlin log attached
merlin.txt
The link to the actual file: https://github.com/bobatkey/ocamlmvc/blob/master/OCamlMVC.ml

@hackwaly
Copy link
Owner

Sorry for the late response. Now it is the Spring Festival in China, I have not enough time to address this issue. I'll work for the bucklescript and js_of_ocaml support later.

@hackwaly
Copy link
Owner

hackwaly commented Feb 3, 2017

@AntouanK

Seems like the problem is that I use zsh as my main shell, and my PATH is defined in .zshrc.
If I launch VSCode manually from a zsh shell, merlin works.

So where can I put PATH so that VSCode can read it?

I've tested on my mac that zsh works well. All env defined in ~/.zshrc works fine. Maybe you've config vscode incorrectly. I found some clues: microsoft/vscode#10500.

If your vscode can't get right env, It's an issue of vscode and I can help less.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants