Haskell-language-server: Duplicate add extension suggestion

Created on 6 Sep 2020  路  11Comments  路  Source: haskell/haskell-language-server

HLS gives me two quick fixes to add the same LANGUAGE extension:

image

One of them is coming from the ghcide plugin, the other one's coming from the Pragmas plugin.
Can we turn one off?

Your environment

  • HLS 0.4.0 head
  • VS Code
  • HLS codebase using the default cradle (Cabal I think)

Steps to reproduce

Screenshot attached

Expected behaviour

I would expect only one suggestion instead of two

Actual behaviour

Seen in the screenshot

ghcide plugins discussion enhancement

All 11 comments

Question is whether such a plugin should live in Ghcide or HLS.

  • DAML probably wants it, suggesting Ghcide.
  • Makes Ghcide a standalone usable IDE, although I'm not sure that's something we want to aim for.
  • Generally decoupling whatever we can is as best as possible, suggesting HLS.

Maybe @cocreature could weigh in?

Seems very similar to the other suggestions we already have in ghcide and it only relies on GHC so I would go for ghcide but I don鈥檛 feel all that strongly about this.

@cocreature - note that this is an existing suggestion, so the question is whether to _delete_ it from Ghcide, or delete it from HLS.

To fix #555, similar code changes would be applied twice to ghcide and HLS if we maintain the status quo.

I would say that all ghcide plugins should be separated from the lib, make them follow the haskell plugin definition (introducing hls-plugin-api as dependency) and make ghcide executable depends on those plugins (like we did in hls)
I would keep them in the ghcide repo to make them available to daml, that maybe would need be refactored to acommodate that change (not sure about that)

That said, that change should be applied as a whole so i would remove the hls plugin in a first step.

@berberman so i would fix it in ghcide and delete the hls plugin in one go

@jneira you should open an issue in the ghcide issue tracker to discuss the extraction of ghcide "plugins".

@jneira you should open an issue in the ghcide issue tracker to discuss the extraction of ghcide "plugins".

I have done this:

https://github.com/haskell/ghcide/issues/935
https://github.com/haskell/ghcide/issues/936

Maybe #630 also has the same root?

So, is this issue still open due to lack of decision to keep/remove Pragma code action from ghcide?

@gdevanla the plan was remove it from his, any reason to prefer it over ghcide one?
And yeah there is no technical reason to wait for do it so a pr would be very welcomed

@gdevanla sorry, i had not seen your pr (#662) that seems to be related. So if the hls plugin is more complete thanks to it, it would be a good reason to keep it and delete ghcide one

Was this page helpful?
0 / 5 - 0 ratings