-
-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2794 Initial HIndent support #2896
Conversation
You will need to add the test suite to the GitHub CI test.yml |
You can setup a handler for the LSP Initialised event and call it there: haskell-language-server/exe/Main.hs Lines 54 to 57 in 65fbc5e
|
I think it would also be fine to call it in the handler, that's what the |
Looks like some yak-shaving required to make this to build: mihaimaruseac/hindent#583 |
Looks like |
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: mihaimaruseac/hindent#585 |
Looks like upstream isn't very responsive at the minute. Perhaps copying |
@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. |
58657f5
to
4b5b209
Compare
Where is still git-dependencty in cabal project, cuz build fix is not released yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple of comment requests.
Left err -> return $ Left $ responseError $ T.pack $ "hident: " ++ err | ||
Right new -> return $ Right $ J.List [TextEdit range (builderToText new)] | ||
|
||
-- Copied from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to the ticket and explain that we can remove this once upstream gives us a better way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
-- | Finding files. | ||
|
||
-- Copied from HIndent, where it was lifted from Stack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈
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! |
@uhbif19 are you able to wrap up this PR? |
@pepeiborra Will try to fix fails in next couple of days. |
bba5bdd
to
ff6994d
Compare
ff6994d
to
9561d0e
Compare
@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 😅 |
Okay, looks like a genuine failure on stackage-lts16 now. |
This looks like hindent problem, I created an issue: mihaimaruseac/hindent#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. |
Pull request was closed
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 providingConfig
should be enough. (https://github.com/mihaimaruseac/hindent/blob/master/src/HIndent.hs#L71)