rls icon indicating copy to clipboard operation
rls copied to clipboard

Create action to automatically fill the hole

Open purpleP opened this issue 5 years ago • 2 comments

Idris (and Haskell I believe nowadays) have what they call typed holes.

https://wiki.haskell.org/GHC/Typed_holes

Idris (and maybe Agda) takes this further and even can automatically try to fit the hole for you. It's a very useful feature from productivity perspective, because compiler literally writes code for you.

Maybe rust can't provide full featured holes for now, but at least you can try to implement this for pattern matching (or maybe I missed something and it exists already). It's very exhausting to write pattern matching by hand for complex enums with large number of alternatives.

purpleP avatar Mar 29 '20 09:03 purpleP

By the way rust-analyzer already does that.

purpleP avatar Apr 20 '20 17:04 purpleP

By the way rust-analyzer already does that.

Nice! Could you post a relevant link documenting this?

fakedrake avatar May 10 '22 13:05 fakedrake