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

ormolu-plugin: don’t request GhcSession for useCLI #4170

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Profpatsch
Copy link

Probably not the best solution.

When ormolu is requested from the command line, it should do its own detection of cabal features. If it has to set up the GhcSession just to get some flags, it blocks saving a file (formatOnSave = true), which is a horrible user experience in cases where the session takes a minute or more to set up.

Instead, now the plugin only depends on ormolu and the file itself.

Fixes #4168

Probably not the best solution.

When ormolu is requested from the command line, it should do its own
detection of cabal features. If it has to set up the GhcSession just
to get some flags, it blocks saving a file (`formatOnSave = true`),
which is a horrible user experience in cases where the session takes a
minute or more to set up.

Instead, now the plugin only depends on ormolu and the file itself.

Fixes haskell#4168
@michaelpj
Copy link
Collaborator

cc @georgefst

This seems plausible to me. We would need to change the fourmolu one to match as they are generally kept in sync.

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.

Formatters block on session setup
2 participants