reasonml-editor / vscode-reasonml

OCaml & Reason support for Visual Studio Code
Apache License 2.0
491 stars 62 forks source link

"Case Split" feature not working when trying the example from repo readme #202

Open jchavarri opened 6 years ago

jchavarri commented 6 years ago

While trying to replicate the example mentioned in the readme for the "Case Split" feature:

Before
let foo (arg: list 'a) => a<cursor>rg;

(I think the readme has the Reason 2 syntax, so I tried with the new one):

let foo = (arg: list(int)) => a<cursor>rg;

But nothing happens. I dug a bit and the error the extension shows is Request reason.server.giveCaseAnalysis failed with message: Destruct not allowed on structure.

I've also tried with variants:

type someVariant =
  | One
  | Two(string)
  | Three(int);
let foo = (arg: someVariant) => a<cursor>rg;

It doesn't work either, but in this case the error is different: Request reason.server.giveCaseAnalysis failed unexpectedly without providing any details..

jchavarri commented 6 years ago

Update (just in case it helps):

If I wrap the function body like

let foo = (arg: list(int)) => {a<cursor>rg;};

or

let foo = (arg: someVariant) => {a<cursor>rg;};

it works.

ghost commented 6 years ago

Hmm, I see. I'm guessing this is due to some sort of changes in how the Reason syntax is parsed by the frontend or by merlin since it used to not be necessary. We could have the editor make those adjustments automatically I suppose. It would be nice if merlin could do that itself though.

quarryman commented 5 years ago

The problem is still there. Case splitting from example still not working.