Hey, great project. I would like to give it a try.
The feature I'm missing the most is a FormattingProvider. It seems it is missing and there are no open issues in regard to it. Is it planned to include formatting?
This is how it's currently integrated in haskell-ide-engine.
https://github.com/haskell/haskell-ide-engine/blob/master/src/Haskell/Ide/Engine/Plugin/Brittany.hs
https://github.com/haskell/haskell-ide-engine/blob/master/src/Haskell/Ide/Engine/Plugin/Floskell.hs
https://github.com/haskell/haskell-ide-engine/blob/master/src/Haskell/Ide/Engine/Plugin/Ormolu.hs
The idea was that things like Hoogle, HLint and Ormolu could be ghcide plugins. They don't need to be in the core, but could easily be layered on top. However, no one has done any plugins yet. It's definitely planned to write them.
Cool. I think as soon there is the first implementation (tested and documented), it can serve as a blueprint for more plugins and it'll be quite easy to adapt and integrate more linters/formatters.
Do you have any thoughts on what the plugin architecture would be? Or is it really a case of using ghcide as a library and adding some extra nodes into the build graph (and some new providers)?
runLanguageServer has as its second argument a PartialHandler. You can compose PartialHandler values with a monoid, so the idea would be each plugin providers a partial handler and you just join those all up. We actually structure the library like this internally, see https://github.com/digital-asset/ghcide/blob/c122ebdc4fbe406d8a8d4da3b46706b49e80557c/src/Development/IDE/LSP/LanguageServer.hs#L99-L106 which is 10 partial handlers joined together.
Right, so the idea is to build your own custom ghcide, a bit like how you would compose your own xmonad binary?
@ocharles originally, yes. However, I'm not 100% convinced, it might be that there's ghcide-core, ghcide which has all the "standard" tools, and then if you want liquid haskell or similar you compose your own.
Got it, thanks! Sorry for taking this off topic :)
It seems like a shame to duplicate effort on plugins for both hie and ghcide.
Hie already has lots of plugins and may soon use ghcide (https://github.com/haskell/haskell-ide-engine/issues/1416#issuecomment-570090407).
Ghcide has a much simpler plugin model, directly mirroring LSP. We're all getting together this weekend to try and converge on one IDE.
I think this would be a feature of https://github.com/haskell/ide, as per https://neilmitchell.blogspot.com/2020/01/one-haskell-ide-to-rule-them-all.html
FYI the required infrastructure should materialise as a result of https://github.com/haskell/ide/issues/30
Looking forward to it
See https://github.com/digital-asset/ghcide/issues/104#issuecomment-595881587 for workaround to use brittany with ghcide with a language client like CoC.
FYI the branch at https://github.com/haskell/haskell-language-server/pull/45 has both floskell and ormolu integrated, selectable as in hie.
And I am hoping to clean it up and get it landed fairly soon, the concept looks good (to me)
hls already supports several formatters as plugins and ghcide will not include them so closing
Most helpful comment
Ghcide has a much simpler plugin model, directly mirroring LSP. We're all getting together this weekend to try and converge on one IDE.