-
Notifications
You must be signed in to change notification settings - Fork 348
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
haskell-cabal: bad indentation with redundant leading comma #1826
Comments
Me too. |
I attempted to fix the indentation for subsections with leading commas or multiple newlines. It should work as expected on the cases:
Do you have any idea? @andreasabel |
This looks good.
What kind of input do you want from me? (Sorry, I fail to comprehend your question.) |
Uh, I was just saying if the patch works for you. Sorry for my ambiguity! |
I am currently using the |
As the Cabal document says, Cabal allows redundant leading (and trailing) commas since 2.2. And some tools such as cabal-fmt use leading commas by default. However, the indentation of such leading commas does not work very well. For example,
When indenting the last line, we may expect
However,
haskell-cabal-indent-line
givesThis is a little annoying. I am not sure if this is caused by my incorrect usage. However, I tried checking if there was a leading comma before indenting and taking different indent strategies, which worked as expected. (Of course, there are still corner cases such as multiple blank lines. But the origin code does not handle them very well either...) I will make a PR if it is OK.
The text was updated successfully, but these errors were encountered: