Coder Social home page Coder Social logo

Comments (16)

gilbert avatar gilbert commented on July 20, 2024 5

My 2c: I just installed this package about four hours ago, and the intellisense was working great! However, after restarting vscode, it seems to have stopped working. I no longer get inline error messages or autocompletions. I also see the command 'reason.showMerlinFiles' not found error.

from vscode-reasonml.

Haroenv avatar Haroenv commented on July 20, 2024 2

I had the same issue because I installed reason-cli etc. while inside the VS Code terminal. When I quit the editor and launched it from another terminal it worked 👍

from vscode-reasonml.

kristojorg avatar kristojorg commented on July 20, 2024 1

Update: After installing reason-cli (which is working properly again now), it now seems to be resolved.

from vscode-reasonml.

richsilv avatar richsilv commented on July 20, 2024 1

In case it's helpful for anyone, I experienced the same problem and resolved it by deleting my local ./node_modules/.cache

from vscode-reasonml.

 avatar commented on July 20, 2024

@bobzhang this is strange. Does it just happen with a specific project (and is the project source available)? Does it always give that error? It might have something to do with the environment detection part of the ocaml server but I'm not sure.

from vscode-reasonml.

kristojorg avatar kristojorg commented on July 20, 2024

I am seeing this as well in chenglou's reason-react-example. It seems to be always giving that error. I'm also seeing an error in vscode itself: command 'reason.showMerlinFiles' not found. Not sure what's going wrong, sorry I am not more help, just getting started on this stuff : /

from vscode-reasonml.

 avatar commented on July 20, 2024

Okay, thanks for letting me know. I'm working on a new release which I think may fix this issue.

from vscode-reasonml.

kristojorg avatar kristojorg commented on July 20, 2024

I just installed reason and merlin through opam (because the reason-cli script is currently broken), and now I am not seeing either of these errors, but now I no longer see a Reason debug output option, and there is no autocomplete available:

screen shot 2017-05-10 at 10 38 18 pm

I suspect the initial issue I was seeing was caused by not having installed the latest reason/merlin/etc.

from vscode-reasonml.

gilbert avatar gilbert commented on July 20, 2024

If it helps, the extensions seems to be perpetually loading:

screen shot 2017-05-10 at 11 42 41 pm

from vscode-reasonml.

 avatar commented on July 20, 2024

@gilbert: you could try adding dependency-env to the project dependencies, installing it, and see if that helps. I thought I had this particular issue fixed but I'll take a look at it and see what's going on.

from vscode-reasonml.

kristojorg avatar kristojorg commented on July 20, 2024

Could it be related to hackwaly/vscode-ocaml#78 ?

from vscode-reasonml.

gilbert avatar gilbert commented on July 20, 2024

@freebroccolo Do you mean https://www.npmjs.com/package/dependency-env ? If so, doesn't seem to help.

It seems I now have Merlin running in VS Code, but it's not picking up my .merlin file:

screen shot 2017-05-19 at 12 06 23 am

I had seen my .merlin file at some point, but I think I'm messing with my ocaml install too much. I don't have intellisense, probably due to this.

Do you think you could provide a list of executables that vscode-reasonml requires to work properly?

from vscode-reasonml.

 avatar commented on July 20, 2024

Do you think you could provide a list of executables that vscode-reasonml requires to work properly?

Normally this extension only requires ocamlmerlin in order to function. The issue with some reason projects is that they do not use opam to install dependencies so they cannot be discovered by Merlin in the same way that OCaml libraries are found.

Instead, the idea is to install OCaml/Reason dependencies for a library locally to node_modules. The problem here that there is not a completely reliable way to detect whether a given project is using dependencies via open or via node_modules. The situation is even more complicated when using an IDE because the environment variables may need to be set up to refer to some particular node_modules which the editor only knows about once the project gets loaded; they can't just be set globally ahead of time.

The way this extension handles the situation is to use some heuristics to try and detect if a project is using local dependencies under node_modules. This involves trying to call dependency-env which is supposed to set the environment variables so that when ocamlmerlin is executed everything just works.

My impression was that this was supposed to be the convention to use for Reason projects which is why I baked it into the editor. The other alternative was to require the user to launch the editor from the terminal through npm run but I do not like this approach because I think it impacts usability too much and frankly it should not be necessary.

In any case, it seems some projects are not using dependency-env. I haven't been paying too close attention to current practices since I haven't had the opportunity to use Reason much lately so maybe the situation has changed.

@jordwalke @chenglou is dependency-env no longer recommended for this?

Anyway, I'll take a look at the project and see if I can figure out what's wrong.

from vscode-reasonml.

 avatar commented on July 20, 2024

Okay, with reason-react-example I think there is either something wrong with the way the .merlin file is setup or maybe there is a communication problem with bucklescript ppx stuff. If you rename or delete .merlin then the interactive features start working but you will get syntax errors for bucklescript specific stuff at that point. But if you just use some standard Reason syntax it will work.

I'll have to investigate further to figure out what is causing this. @bobzhang any ideas?

from vscode-reasonml.

 avatar commented on July 20, 2024

Closed since I don't know what caused the original issue and would need more information.

from vscode-reasonml.

avsm avatar avsm commented on July 20, 2024

I ran across this issue in OCaml. It manifests as the extension remaining as "loading" perpetually. I didn't have merlin installed, so I resolved it by opam install merlin and reloading the extension, and it works great!

from vscode-reasonml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.