Closed vramana closed 7 years ago
Ah, did you update to the latest atom-reason-loader
?
Did you restart? Could you let me know which version of atom-reason-loader you have, just to double check that you got our latest stuff.
I think so. I am using atom-reason-loader@0.5.0
Oh, I think I know what might be happening. You already have an Atom editor window open so it uses an old PATH?
Hmm, that's probably not it actually. I just tried running npm run editor
when I already had an Atom window open and it worked. (Good news is that workflow worked for me! Meaning npm run editor
is probably not a bad workflow in the general case) Still have to figure out what your issue is though.
Maybe it's an issue with Linux paths? (Cheng Lou said it was working for him on Mac, and it works for me on Mac).
Oh, I think I know what might be happening. You already have an Atom editor window open so it uses an old PATH?
No. Reopened my terminal and checked again.
Maybe it's an issue with Linux paths? (Cheng Lou said it was working for him on Mac, and it works for me on Mac).
Possible. Any ideas on how I can debug this?
In the console in Atom, I believe you can type things like:
process.env.PATH
To see the path.
And
require('child_process').execSync('which ocamlmerlin').toString()
To run commands inside the editor with its environment.
process.env.PATH.split(':')
/home/vramana/Documents/reasonml/ExampleProject/node_modules/camomile/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/zed/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/react/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/ppx_tools/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/conf-ncurses/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/camlp4/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/base-no-ppx/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/lwt/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/lambda-term/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/utop/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/merlin-extend/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/cppo/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/conf-which/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/biniou/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/yojson/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/merlin/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/menhir/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/easy-format/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/ounit/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/base-bytes/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/re/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/opam-installer-bin/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/conf-m4/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/ocamlfind/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/ocaml/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/ANSITerminal/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/BetterErrors/_build/ocamlfind/bin
/home/vramana/Documents/reasonml/ExampleProject/node_modules/reason/_build/ocamlfind/bin
// ... some unrelated paths
require('child_process').execSync('which ocamlmerlin').toString()
"/home/vramana/Documents/reasonml/ExampleProject/node_modules/merlin/_build/ocamlfind/bin/ocamlmerlin
"
This seems wierd.
Could you also try commenting out the line in your .bashrc
where you load the opam paths? Maybe it's confusing things - the fact that your paths include opam and npm locations?
I have removed that already. This is the full list of paths.
Thanks for testing this stuff.
I'll take a look tomorrow - it would be good if you can find another Linux user who could repro. I'm on the latest Atom beta btw. Not sure if that matters.
Even I am on atom-beta. I don't where I can another Linux user. I'll try running ubuntu without opam on Virtualbox.
You could ask in gitter, too.
I have completely removed opam and even then atom still gives the same error.
I tried to see if vim works. Vim takes a really long time to open (7 secs or so). Then when I try to ReasonPrettyPrint. I get the following error
Ah! One thing that might not be helping: what's the .merlin have for S sources? Is it the node modules directory? Try removing that. That has so many files to search through it tanks Merlin. I like your approach of getting it to work in Vim first. Also you saw the updated instructions for vim?
@jordwalke Yes. I saw them and updated my vimrc.
Removing node_modules brings things back to normal speed. No more autocomplete though 😦 .
Also that error comes when saving the file not when I run ReasonPrettyPrint. ReasonPrettyPrint works totally fine.
I bet this has something to do with paths (something working on mac, but not linux). So we should do to ocamlmerlin
whatever we're doing for reason
to augment the path (where refmt
comes from).
Closing issues this since it's fixed in the atom-reason plugin long back. I don't know the status of vim error though. Will file a different issue for it.
When I run
npm run whereisocamlmerlin
, which is successfully locating ocamlmerlinBut when I run![image](https://cloud.githubusercontent.com/assets/3112509/18307652/eefbbd0a-750e-11e6-8d11-24e8630c85d3.png)
npm run editor
, I get the errorcc @jordwalke