Importing a union type from a module (in all ways but one) either breaks insertion of case/of statements, or inserts case/of statements that will not function.
For an example, if I have this module:
module Exporter exposing (..)
type Test
= Test1
| Test2
And I import it with
import Exporter exposing (Test(..))
or
import Exporter exposing (Test(Test1, Test2))
The case/of insertion will not be provided.
If on the other hand I import with
import Exporter exposing (Test)
or
import Exporter
Then the insertion will be provided as
case test of
Test1 ->
Test2 ->
Which will not work because Test1 and Test2 aren't imported.
The only way to make this setup work is to import exposing everything
import Exporter exposing (..)
If this cannot be fixed easily, then perhaps giving the option to insert case/of statements using the qualified name of the constructors could be provided (since qualified imports are officially preferred anyway)? e.g.
Importing a union type from a module (in all ways but one) either breaks insertion of case/of statements, or inserts case/of statements that will not function.
For an example, if I have this module:
And I import it with
import Exporter exposing (Test(..))
orimport Exporter exposing (Test(Test1, Test2))
The case/of insertion will not be provided.If on the other hand I import with
import Exporter exposing (Test)
orimport Exporter
Then the insertion will be provided asWhich will not work because Test1 and Test2 aren't imported.
The only way to make this setup work is to import exposing everything
import Exporter exposing (..)
If this cannot be fixed easily, then perhaps giving the option to insert case/of statements using the qualified name of the constructors could be provided (since qualified imports are officially preferred anyway)? e.g.