isovector / haskell-language-server

Integration point for ghcide and haskell-ide-engine. One IDE to rule them all.
Apache License 2.0
0 stars 2 forks source link

Split tactic for datatypes #30

Closed WorldSEnder closed 3 years ago

WorldSEnder commented 3 years ago

Implements #21 but allowing datatypes with more than one constructor: one code action per constructor is produced.

In the current state, the constructor is not scope checked. This works fine most of the time, but might cause troubles down the line. I'm not sure how to implement scope checking correctly: imports might be qualified, renamed or specific to some constructors only. Is there existing machinery to deal with that sort of backwards name resolution inplace of just using occName as I did here?

isovector commented 3 years ago

This is excellent work, thank you @WorldSEnder!

We don't have a good story around scoping rules yet, so I wouldn't worry about it in this PR. I'm more worried about unexported data cons than unqualified occnames, as other plugins will notice the issue and suggest fixes.

I'm happy to merge this if you're happy with it!

isovector commented 3 years ago

I'll merge this later today!

WorldSEnder commented 3 years ago

And with the addition of not suggesting I# for goals of type Int by default I'm happy with the code