Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infered types and refmt on MacOS #37

Closed
lexaurin opened this issue Mar 16, 2018 · 8 comments
Closed

Infered types and refmt on MacOS #37

lexaurin opened this issue Mar 16, 2018 · 8 comments

Comments

@lexaurin
Copy link
Contributor

plugin version: 0.41
os: MacOS HighSiera

Hi there,

first of all, thanks for the plugin, it's nice to see Reason integration in Webstorm. 👍

What I'm not sure about if it's a bug or my misunderstanding of documentation is these two issues

  1. I don't see inferred types in editor, like you have on screenshots https://github.com/reasonml-editor/reasonml-idea-plugin/blob/master/docs/type.gif Is this a bug or is there some option to turn it on in WebStorm?
  2. refmt is not formatting code automatically (I have to manually press ⌘⎇⇧R to reformat) while in the documentation is "reformat (by default, action is also mapped to crtl alt shift R)"

screen shot 2018-03-16 at 11 11 05

@jsiebern
Copy link

Also if I try to open the settings it gets stuck saying "Loading..."

macos-reason-settings

@giraud
Copy link
Owner

giraud commented Mar 16, 2018

Hi!

it's cool if it can help you.

  1. first you need to check if your sources are compiled without errors. If you open the bucklescript window you will see the logs from the bucklescript process. Check that's ok.
    If compilation is ok, check if you are using "namespace": true in your bsconfig.json, because in this case type inference won't work (Type annotations not working with bs namespace #35).

  2. I dont understand what you mean.

color settings fixed in next release

@lexaurin
Copy link
Contributor Author

@giraud

  1. that was it. "namespace": true was set by bsb -init my-react-app -theme react. So maybe add a note about it until it is fixed? Add a note about namespace: false and inferred types #38
  2. I mean that I'm not sure if refmt should work on WebStorms save/autosave or is it just mapped to ⌘⎇⇧R shortcut?

@giraud
Copy link
Owner

giraud commented Mar 18, 2018

yes, you're not the first one to be confused.
I disabled the format on save, it's not working. I have to update the doc maybe.

@lexaurin
Copy link
Contributor Author

I see. Thanks for info.

@giraud
Copy link
Owner

giraud commented Mar 19, 2018

Color settings fixed in 0.42

@giraud giraud closed this as completed Mar 19, 2018
@Coobaha
Copy link
Contributor

Coobaha commented Mar 23, 2018

Hi @giraud,

in 0.43 refmt command is not working but it was working in 0.42

image

2018-03-23 14:37:28,497 [ 628312]   INFO -                       ReasonML - Identifying 'node_modules/bs-platform/lib/refmt3.exe' binary 
2018-03-23 14:37:28,497 [ 628312]   INFO -                       ReasonML - Property 'REASON_REFMT_BIN' not found, testing environment variable 'reasonRefmt' 
2018-03-23 14:37:28,497 [ 628312]   WARN -                       ReasonML - No 'node_modules/bs-platform/lib/refmt3.exe' found in environment or properties, use default one 
  "name": "bs-platform",
  "version": "2.2.3",

there is only refmt.exe

as a workaround I did add custom VM option
-DreasonRefmt=./node_modules/bs-platform/lib/refmt.exe

@giraud
Copy link
Owner

giraud commented Mar 23, 2018

I've created an issue to follow that problem #40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants