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

What's current solution to enable BangPatterns (etc.) without putting it in every file? #650

Closed
complyue opened this issue Sep 7, 2020 · 2 comments
Labels
question Further information is requested

Comments

@complyue
Copy link

complyue commented Sep 7, 2020

Describe the bug
This is a technical question, maybe a bug in documentation.

I can't figure out on my own how to:

enable BangPatterns (etc.) without putting it in every file

PR #157 marked many related issues solved, but BangPatterns seems not working still, and I don't know how to tell ormolu about it, as the configuration seems removed. (my .cabal file already has it for the record)

Or it can only be enabled by putting pragma per source file, I think it's better stated in some obvious where.

To Reproduce
Let ormolu format a file with BangPatterns syntax, but no language pragma in that file. Such a file normally exists in a project with .cabal file stating what language extensions are enabled.

Expected behavior
Format without err out.

Environment
Any

Additional context
No

@mrkkrp
Copy link
Member

mrkkrp commented Sep 7, 2020

Use --ghc-opt -XBangPatterns.

@mrkkrp mrkkrp added the question Further information is requested label Sep 7, 2020
@complyue
Copy link
Author

complyue commented Sep 7, 2020

Wah! That's so quick! @mrkkrp

And I'm working from VSCode with HLS, it has "ormolu" as an option under "Formatting Provider", but seems no cmdl conf options there, maybe I should file an issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants