-
-
Notifications
You must be signed in to change notification settings - Fork 389
Bump Fourmolu to 0.4 #2254
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
Merged
Merged
Bump Fourmolu to 0.4 #2254
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8342138
Allow Fourmolu 0.4
georgefst bc56d49
Reformat record construction to Fourmolu style
georgefst c96314d
Run stylish-haskell on imports
georgefst ed50c8b
Enable fourmolu for ghc-9
jneira cd016ec
Enable fourmolu tests for ghc-9
jneira c540450
Enable fourmolu for ghc-9 and stack
jneira b16a028
Correct stack-9.0.1.yaml changes
jneira ddfe020
Use explicit import to avoid shadowing
georgefst 46d3264
Remove unused import
georgefst 3f45fac
Bump plugin version
georgefst 7c42612
Enable -Wall
georgefst 7288e42
Merge branch 'master' into fourmolu-0.4
jneira 0d5c3ef
Merge branch 'master' into fourmolu-0.4
jneira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,21 +8,20 @@ module Ide.Plugin.Fourmolu ( | |
provider, | ||
) where | ||
|
||
import Control.Exception (try) | ||
import Control.Lens ((^.)) | ||
import Control.Exception (try) | ||
import Control.Lens ((^.)) | ||
import Control.Monad.IO.Class | ||
import Data.Bifunctor (first) | ||
import qualified Data.Text as T | ||
import Development.IDE hiding (pluginHandlers) | ||
import Development.IDE.GHC.Compat as Compat hiding (Cpp) | ||
import Data.Bifunctor (first) | ||
import qualified Data.Text as T | ||
import Development.IDE hiding (pluginHandlers) | ||
import Development.IDE.GHC.Compat as Compat hiding (Cpp) | ||
import qualified Development.IDE.GHC.Compat.Util as S | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know how this file was passing CI before? Seeing as this line causes |
||
import GHC.LanguageExtensions.Type (Extension (Cpp)) | ||
import GhcPlugins (HscEnv (hsc_dflags)) | ||
import Ide.PluginUtils (makeDiffTextEdit) | ||
import GHC.LanguageExtensions.Type (Extension (Cpp)) | ||
import Ide.PluginUtils (makeDiffTextEdit) | ||
import Ide.Types | ||
import Language.LSP.Server hiding (defaultConfig) | ||
import Language.LSP.Server hiding (defaultConfig) | ||
import Language.LSP.Types | ||
import Language.LSP.Types.Lens | ||
import Language.LSP.Types.Lens (HasTabSize (tabSize)) | ||
import Ormolu | ||
import System.FilePath | ||
|
||
|
@@ -70,10 +69,10 @@ provider ideState typ contents fp fo = withIndefiniteProgress title Cancellable | |
format mempty | ||
ConfigParseError f (_, err) -> do | ||
sendNotification SWindowShowMessage $ | ||
ShowMessageParams | ||
{ _xtype = MtError | ||
, _message = errorMessage | ||
} | ||
ShowMessageParams | ||
{ _xtype = MtError | ||
, _message = errorMessage | ||
} | ||
return . Left $ responseError errorMessage | ||
where | ||
errorMessage = "Failed to load " <> T.pack f <> ": " <> T.pack err | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, I'd remove 0.3 entirely, as 0.4 includes some important bug fixes. But this isn't possible while
stylish-haskell
is tied to older versions of GHC and Cabal.(Same applies to Ormolu here - right now, the latest version will never be chosen by the dependency solver)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, looks like this only applies to GHC < 9. The
stylish-haskell
plugin is disabled for 9.0.1.And if CI passes here for GHC 9.0.1, we know that Fourmolu 0.4 is being used, since it's the first version to support it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe adding a comment about, to remove 0.3 some day?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think there's no need. I'll probably end up at least trying to remove it every time I bump the upper bound, and eventually it'll be possible.