Add support for post qualified import formatting.#335
Add support for post qualified import formatting.#335jhmcstanton wants to merge 1 commit intohaskell:mainfrom
Conversation
Adds an option to use post qualified module imports. Related to haskell#284 Resolves haskell#334
| # > import qualified Data.Foo as F | ||
| # | ||
| # Default: false | ||
| ghc_lib_parser: false |
There was a problem hiding this comment.
This ghc_lib_parser option was removed since it is not used.
|
Not sure what the issue is with that mac build, classic case of "works on my machine". Not sure that I have access to rerun the build though, can someone with access trigger that for me (or show me how) ? |
|
This is exactly what I'm looking for right now. It seems like the build error is the same one I got on #337, @jaspervdj, could we ignore it again for this PR? |
|
hm, this seems to fail on post qualified explicit imports: import Data.Aeson qualified as JSON (Value)gives me: I'll add a few failing test cases later today |
| , testCase "case 31" case31 | ||
| , testCase "case 32" case32 | ||
| , testCase "case 33" case33 | ||
| ] |
There was a problem hiding this comment.
| ] | |
| , testCase "case 34" case34 | |
| , testCase "case 35" case35 | |
| , testCase "case 36" case36 | |
| , testCase "case 37" case37 | |
| ] |
| , "" | ||
| , "import Data.Foo (Foo (Bar, Foo), Goo (Goo))" | ||
| , "import Data.Set (empty, intersect, nub)" | ||
| ] |
There was a problem hiding this comment.
| ] | |
| ] | |
| -------------------------------------------------------------------------------- | |
| case34 :: Assertion | |
| case34 = assertSnippet (step Nothing defaultOptions {postQualified = True}) | |
| [ "import qualified Data.Aeson as JSON (Value)" | |
| ] | |
| [ "import Data.Aeson qualified as JSON (Value)" | |
| ] | |
| -------------------------------------------------------------------------------- | |
| case35 :: Assertion | |
| case35 = assertSnippet (step Nothing defaultOptions {postQualified = True}) | |
| [ "import Data.Aeson qualified as JSON (Value)" | |
| ] | |
| [ "import Data.Aeson qualified as JSON (Value)" | |
| ] | |
| -------------------------------------------------------------------------------- | |
| case36 :: Assertion | |
| case36 = assertSnippet (step Nothing defaultOptions {postQualified = True}) | |
| [ "import qualified Data.Aeson as JSON (Value)" | |
| , "import qualified Data.Aeson as JSON (encode, decode)" | |
| ] | |
| [ "import Data.Aeson qualified as JSON (Value, decode, encode)" | |
| ] | |
| -------------------------------------------------------------------------------- | |
| case37 :: Assertion | |
| case37 = assertSnippet (step Nothing defaultOptions {postQualified = True}) | |
| [ "import Data.Aeson qualified as JSON (Value)" | |
| , "import Data.Aeson qualified as JSON (encode, decode)" | |
| ] | |
| [ "import Data.Aeson qualified as JSON (Value, decode, encode)" | |
| ] | |
There was a problem hiding this comment.
@jhmcstanton I've also added these changes as a PR to your branch, in case that's easier to work with
|
@jhmcstanton would it be much work now to rebase this against |
Adds an option to use post qualified module imports.
Related to #284
Resolves #334
Let me know if any more tests or changes are needed.