nwolverson / purescript-language-server

MIT License
183 stars 41 forks source link

Over-eager collapsing of clashing dctor/type imports #174

Closed nwolverson closed 2 years ago

nwolverson commented 2 years ago

There is logic to collapse the imports suggested when data Foo = Foo | Bar, so that only the dctor import version (Foo(...)) is offered, but this is being applied incorrectly:

data Random = Foo Foo
data Foo = Foo1 | Foo2

Only the data contstructor Foo :: Foo -> Random is offered, leading to Random(...) import, but I want Foo or Foo(...). If we can't determine the type/dctor relationship we shouldn't make any decisions based on it.