Skip to content
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

Add missing documentation for cabal formatters #4322

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented Jun 14, 2024

Fixes #4313

Adds documentation about the default formatters. I am not sure that's the correct location, though, to document the defaults.

@fendor fendor requested a review from michaelpj as a code owner June 14, 2024 09:24
Copy link
Collaborator

@jhrcek jhrcek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

docs/features.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should document default values for options here. Someone was working on auto-generating option documentation at Zurihac, that would be the ideal place for it...

@@ -119,12 +120,17 @@ Format your code with various Haskell code formatters.
| Ormolu | `hls-ormolu-plugin` |
| Stylish Haskell | `hls-stylish-haskell-plugin` |

---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this do anything?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visual separation

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this markdown syntax is usually translated to <hr/> in html, so should be fine.

Format your cabal files with a cabal code formatter.
The default cabal code formatter is `cabal-gild`, which needs to be available on the `$PATH`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a great experience, actually. So the default behaviour will send people errors, since most people won't have installed this? I think our default behaviour shouldn't rely on any external programs, which makes me think we should set the default cabal formatter to "none".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... do we have a "none" formatting provider option? We maybe should do.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I thought we did. We definitely should have a "none" option.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the initial experience is not good. In the case of cabal-gild, we can likely ship it with all supported GHC versions.

However, perhaps we should start shipping the binaries instead of linking it into HLS directly. Then every HLS version would have the same formatter version. Let's give #411 another kick.

@fendor
Copy link
Collaborator Author

fendor commented Jun 14, 2024

Seems like I forgot to add the cabalFormattingProvider to vscode 🙈 My mistake.

haskell/vscode-haskell#1099

@fendor
Copy link
Collaborator Author

fendor commented Jul 25, 2024

@michaelpj I think we should merge this as is, as it merely documents the status-quo

@michaelpj michaelpj merged commit a4bcaa3 into haskell:master Jul 26, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lack of documentation of cabal-fmt & cabal-gild
3 participants