Comments (15)
The problem turned out to be the environment (I opened vscode
with dmenu
) vscode
was running on did not have them on PATH. Everything works fine when I opened vscode
from the terminal. Thanks for taking your time.
from vscode-reasonml.
I'm not sure what is causing that without more information about how your project is set up. Do you have merlin installed local to the project?
from vscode-reasonml.
I have following settings set up in user settings
"reason.path.ocamlmerlin": "/home/absolutezero/.opam/4.03.0/bin/ocamlmerlin",
"reason.path.refmt": "/home/absolutezero/.opam/4.03.0/bin/refmt",
"reason.path.rtop": "/home/absolutezero/.opam/4.03.0/bin/rtop",
"reason.formatOnSave": true
from vscode-reasonml.
How do I install merlin locally to the project?
from vscode-reasonml.
I cloned this project: https://github.com/reasonml/ReasonNativeProject
It already has .merlin
.
from vscode-reasonml.
I cloned this project: https://github.com/reasonml/ReasonNativeProject
It already has .merlin.
Can you try unsetting the user settings you mentioned above? As long as your PATH
is set up correctly you shouldn't need to use them unless you have some custom versions or something. If you don't override them, the reason mode should use the ocamlmerlin
binary that is installed when you set up the dependencies with npm or whatever.
from vscode-reasonml.
I get the following error when I unset those settings
/home/absolutezero/.vscode/extensions/freebroccolo.reasonml-0.0.99/node_modules/ocaml-language-server/out/src/server/processes/merlin.js:25
throw error;
^
Error: spawn ocamlmerlin ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[Error - 6:58:42 AM] Connection to server got closed. Server will not be restarted.
But ocamlmerlin
should be in PATH as
$ which ocamlmerlin
/home/absolutezero/.opam/4.03.0/bin/ocamlmerlin
from vscode-reasonml.
How do you have your shell environment setup? How did you install opam? For whatever reason, when node tries to spawn ocamlmerlin
, the binary is not in the path.
from vscode-reasonml.
I installed opam with what opam's website instructs to do:
wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin
And for reason
, I installed it with opam install reason
.
from vscode-reasonml.
Maybe opam is not being initialized properly (and thus not setting the path) for new shells in some cases. Do you get the same output from the following commands?
sh -c ocamlmerlin
sh -cl ocamlmerlin
from vscode-reasonml.
Yes
from vscode-reasonml.
Oops, those commands should have run ocamlmerlin
instead of opam
. Can you try that? It probably won't make a difference but stillβ¦
I think the opam installer script should have either modified one of your shell init scripts or asked you to modify it manually. Do you see that somewhere in like ~/.profile
or ~/.bash_profile
or maybe one of the zsh files if you use that?
The only thing I can really think of is that there's some sort of misconfiguration with how the shell is initializing the opam stuff but it's hard to pinpoint from a distance.
from vscode-reasonml.
sh -c ocamlmerlin
runs off. But the other one:
$ sh -cl ocamlmerlin
sh: ocamlmerlin: command not found
Also in my .zshrc
, the following line has been added.
. /home/absolutezero/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
from vscode-reasonml.
. /home/absolutezero/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
It's a long shot but you could try moving this to ~/.zshenv
instead and seeing if that helps. I think with ~/.zshrc
opam may only be initializing the path for login shells which could explain why it's failing for node but not when you try it manually.
from vscode-reasonml.
Not working π
from vscode-reasonml.
Related Issues (20)
- Error starting reason-vscode "expected string", fix error message for invalid bsconfig.json HOT 1
- Options for ReasonML formatting?
- BSC.exe: Wrong Argument. -bs-jsx expects an integer HOT 4
- Incorrect problem matcher for ocaml >= 4.09
- Wrong module for "go to definition" HOT 3
- merlin error reporting can be excessive
- [Feature] Completion on labelled arguments
- Unable to run first ocaml "hello world" program.
- Double error/warning dislayed
- WSL: opam local switch environment
- What does this highlighting of a whole function mean?
- Ternary Operators are Highlighted as bool
- Restart Merlin? HOT 1
- Why is the highlighting for OCaml so weird?
- Node module errors preventing extension from working
- Autocomplete not working HOT 1
- OCaml: Incorrect syntax highligthing if identifier starts with let
- Request textDocument/formatting failed
- VS Code: we have marked your extension as deprecated HOT 3
- Hijacking Markdown code block highlighting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-reasonml.