Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Option to Disable Merlin (important for Windows) #102

Closed
superherointj opened this issue Sep 17, 2017 · 11 comments
Closed

Option to Disable Merlin (important for Windows) #102

superherointj opened this issue Sep 17, 2017 · 11 comments
Milestone

Comments

@superherointj
Copy link

superherointj commented Sep 17, 2017

Merlin windows support is broken.

Having an option to disable Merlin is desirable for:

  • Suppressing errors.
  • Enabling BsRefmt. (doesn't work if Merlin is broken.)
  • Enjoying syntax highlighting error free.

Even if Merlin is sorted out it still makes sense having a way to disable it. Because:

  • The 'ocaml-for-windows' hack shouldn't be required.
  • Merlin is optional.
  • Merlin might be replaced by another tool later. (Like bsb errors)
  • For debug purposes
  • Merlin might become broken again. Who knows?
  • Other uses we are not aware now.

Either Merlin works or it's necessary to allow disabling for scenarios it doesn't work.

@superherointj superherointj changed the title Allow to Disable Merlin for specific environments & languages (important for Windows) Option to Disable Merlin (important for Windows) Sep 17, 2017
@yawaramin
Copy link

This relates to reasonml/reason#1190

@OlegLustenko
Copy link

you can try reasonml/reasonml.github.io#109

it mostly works for me out of the box, only 1 requirements you need to set this in vscode settings

 "reason.path.ocamlfind": "ocamlfind.cmd",
  // The path to the `ocamlmerlin` binary.
  // "reason.path.ocamlmerlin": "ocamlmerlin.cmd",
  // The path to the `opam` binary.
  "reason.path.opam": "opam.cmd",
  // The path to the `rebuild` binary.
  "reason.path.rebuild": "rebuild.cmd",
  // The path to the `refmt` binary.
  "reason.path.refmt": "refmt.cmd",
  // The path to the `refmterr` binary.
  "reason.path.refmterr": "refmterr.cmd",
  // The path to the `rtop` binary.
  "reason.path.rtop": "rtop.cmd",

@superherointj
Copy link
Author

superherointj commented Sep 27, 2017

Did: npm install -g ocaml-on-windows
Now I have ocaml 4.04.0 in path + tools in Windows Command Prompt (good!)
Refmt is working on VSCode. (great!)

But Merlin is still not working...

Current VSCode configuration:

{
"reason.path.ocamlfind": "ocamlfind.cmd",
"reason.path.ocamlmerlin": "ocamlmerlin.cmd",
"reason.path.opam": "opam.cmd",
"reason.path.rebuild": "rebuild.cmd",
"reason.path.refmt": "refmt.cmd",
"reason.path.refmterr": "refmterr.cmd",
"reason.path.rtop": "rtop.cmd",
"reason.formatOnSave": true
}

Current VSCode errors:

ocamlmerlin error: sh: 1:
ocamlmerlin error: C:UsersUsernameAppDataRoaming: not found
ocamlmerlin error: sh: 1: C:UsersUsernameAppDataRoaming: not found
ocamlmerlin error: sh: 2: pm: not found

I find really weird/fishy this 'C:UsersUsernameAppDataRoaming' error. A path problem... But how to fix it?

@fhelwanger
Copy link

fhelwanger commented Sep 27, 2017

It seems that merlin isn't finding your project's path.

Did you opened a file or a folder on vscode? If you opened a file, try opening your project's root folder.

@superherointj
Copy link
Author

superherointj commented Sep 27, 2017

I have opened VSCode in the project folder exactly where '.merlin' file is. Any other idea?

@fhelwanger
Copy link

fhelwanger commented Sep 27, 2017

Oh, it's happening for me too. I get:

ocamlmerlin error: sh: 1: C:Tempocaml
eason-react-example: not found

Something must have changed lately that is handling \ as an escape char 😞

@ghost ghost added this to the v1.1.0 milestone Sep 27, 2017
@frankwallis
Copy link

Also related ocaml/merlin#684

@superherointj
Copy link
Author

superherointj commented Oct 2, 2017

It is working now. I'll close this.

Update: It only fixed somewhat. There is still a situation that it is broken. Considering the existence or not of Merlin file. And it's content. Depending on which environment the file was generated (Linux/Windows) it get's broken.

@frankwallis
Copy link

@superherointj good news! What changed to make this work? do I need to upgrade merlin?

@superherointj
Copy link
Author

Just updated VSCode extension to version 1.0.1. There was a patch this night. I already had 'ocaml-on-windows' installed.

@superherointj
Copy link
Author

It seems the problem persists if Merlin file is present.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants