question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add configuration option to choose reformatter

See original GitHub issue

Background

Since upgrading to the latest Beta, I’ve noticed how radically different (and unconfigurable) Ormolu’s output is to hindent + stylish-haskell. However, there’s no easy way to apply one formatter (other than the new shortcut, which only sometimes works for me)

Feature Request

It would be great for users to be able to choose which formatter to use (by default?), e.g. via a dropdown in the settings menu, e.g. (excuse the ASCII art here)

Formatter:   |    stylish-haskell  v|
             |......................|
             |      ormolu          |
             |      hindent         |
             |      brittany        |   
             \----------------------/

Alternatively / additionally this could be configured in the extended code reformat menu maybe?

Notes

The normal shortcut keys could apply all the time, and it would remain easy to add formatters (e.g. see #319)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rikvdkleijcommented, May 6, 2020

Thanks for reporting!

I will consider it and think about a simple/maintainable solution. Btw, hindent is not maintained anymore AFAIK. Could be that the alternative reformatters have to be build by yourself and be configured in Haskell Settings.

0reactions
declensioncommented, Apr 27, 2021

This will still be a great benefit for us. Not everyone like Ormolu, but having the plugin auto-apply formatting is great!

One more to add to the list: https://github.com/parsonsmatt/fourmolu ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Format Code with Prettier in Visual Studio Code
To do so, click the Configure button: Prompt for selecting a default formatter. Then choose Prettier - Code Formatter. Selecting Prettier.
Read more >
VS Code tips — Managing multiple formatters (and selecting a ...
The editor.defaultFormatter setting in VS Code lets you configure which of your installed formatters is run for a given language.
Read more >
How do you change the formatting options in Visual Studio ...
go to file -> preferences -> settings search for format , on the left side, click on Text Editor , the very first...
Read more >
How to configure Prettier and VSCode - Gleb Bahmutov
js gets formatted by Prettier using different local settings and ends up looking different. Single quotes, no semi-colons, trailing commas.
Read more >
How to set up Prettier and automatic formatting on VS Code
Step 1: Install Prettier ... Click on the configure button. ... After you click on configure, select Prettier as the default formatter.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found