haskell-language-server
                                
                                 haskell-language-server copied to clipboard
                                
                                    haskell-language-server copied to clipboard
                            
                            
                            
                        #2794 Initial HIndent support
I am not quite sure if I am using HIndent API correctly, but it does format something.
Currently I do not handle config, cuz not sure where to call getConfig :: IO Config (https://github.com/mihaimaruseac/hindent/blob/master/src/main/Main.hs#L77).
There is some story with [Extension] param. As far as I understand providing Config should be enough. (https://github.com/mihaimaruseac/hindent/blob/master/src/HIndent.hs#L71)
You will need to add the test suite to the GitHub CI test.yml
Currently I do not handle config, cuz not sure where to call
getConfig :: IO Config(https://github.com/mihaimaruseac/hindent/blob/master/src/main/Main.hs#L77).
You can setup a handler for the LSP Initialised event and call it there:
https://github.com/haskell/haskell-language-server/blob/65fbc5e41cf407ce98a03f5faa0a1b93c995b7d6/exe/Main.hs#L54-L57
I think it would also be fine to call it in the handler, that's what the stylish-haskell plugin does, for example.
Looks like some yak-shaving required to make this to build: https://github.com/mihaimaruseac/hindent/issues/583
Looks like getConfig is not exported from hindent. So I can either try to change hindent or copy getConfig with Path.File and bunch of dependencies. Which way is better?
So I can either try to change hindent
That would be ideal. Maybe open an issue and see what the maintainer thinks is the best way of doing it. People are typically happy to be included in HLS, so hopefully you'll get a response :)
Issue created: https://github.com/mihaimaruseac/hindent/issues/585
Looks like upstream isn't very responsive at the minute. Perhaps copying getConfig is the least bad option in the short term?
@michaelpj Maybe I will write universal config-looking function working for both HIndent and Stan? Where should I place it?
I don't think that necessarily makes sense since different projects have different config mechanisms. As much as possible we should use upstream.
@michaelpj
getConfig was added and tests use configuration file now.
Where is still git-dependencty in cabal project, cuz build fix is not released yet.
Sorry, just one last thing I missed before - docs! Can you add this plugin to the "Features" doc and also add a line for it about GHC version support on the GHC version compatibility page.
@michaelpj Circleci CI tasks are stalled. Can I do something to fix this?
Not sure tbh!
They seem to be passing on other jobs, maybe just try pushing a trivial commit and see if they start up this time?
@michaelpj Tried. Seems like it still does not work.
It does just seem to be this PR, I really have no idea why. Try making another PR with the same content?
@michaelpj These PR seems stuck too:
https://github.com/haskell/haskell-language-server/pull/2949 https://github.com/haskell/haskell-language-server/pull/2956 https://github.com/haskell/haskell-language-server/pull/2908
CI fails on Nix builds. Nix tries to build hindent 5.3.2 while deps use another version, I do not know why.
@uhbif19 are you able to wrap up this PR?
@pepeiborra Will try to fix fails in next couple of days.
@michaelpj Another strange CI (bug?): "Could not find a usable config.yml because you deleted the CircleCI OAuth app."
Do you know anything about it?
You are oddly cursed, nobody else seems to have trouble with CircleCI :sweat_smile:
Okay, looks like a genuine failure on stackage-lts16 now.
This looks like hindent problem, I created an issue: https://github.com/mihaimaruseac/hindent/issues/589
Now all CI jobs are getting stuck.
@uhbif19 are you able to resolve the conflicts? Hopefully that will unstuck CI
Lol, I forgot about this PR. Does anyone need it?
Nobody has asked for it since this PR has been open, so I think it's not that popular and probably not worth it.