reasonml-editor / atom-ide-reason

ReasonML/OCaml language support for Atom-IDE, using ocaml-language-server under the hood.
MIT License
34 stars 8 forks source link

add toolchainPath support #17

Closed clouds56 closed 6 years ago

clouds56 commented 6 years ago

By using this patch, we could write "toolchainPath" like before and it would auto detect tools in path and add it to config (with low priority, could be override with specific path settings like path.refmt in the same file)

zaaack commented 6 years ago

I'm not sure this is needed anymore, the configuration already contains the path of env binary, you can easily override it with a custom env bin like:

"env": "./.atom/reason-env.sh"

zaaack commented 6 years ago

@clouds56 Do you still need to merge this PR? Can you try something like this?

"env": "env PATH=/some/extra/path:$PATH"
clouds56 commented 6 years ago

There're some slight difference. The env changes path (change the path means a little more than change tools path), but my patch detect tools and set correspond setting.reason.path.* (and also no need of external script) If https://github.com/freebroccolo/ocaml-language-server/pull/101 got merged/fixed, changing content in "./.atom/reason-env.sh" would not trigger ocamlmerlin-server to restart automatically (the path of env is literally the same.

this is just a proposal, it's fine that you don't like it (just a bit more complicated when config)

EDIT: and AFSIK the "env" doesn't even called in ocaml-language-server for starting ocamlmerlin-server, it is only used for giveProjectEnv request.