mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-12-25 18:51:41 +03:00
ModuleNameLookupTableTest: Refactor declaration visitor
This commit is contained in:
parent
ccfcc99468
commit
efebce84d1
@ -69,6 +69,10 @@ a = localValue
|
|||||||
b = case () of
|
b = case () of
|
||||||
VariantA -> ()
|
VariantA -> ()
|
||||||
(ExposesEverything.VariantA as foo) -> foo
|
(ExposesEverything.VariantA as foo) -> foo
|
||||||
|
|
||||||
|
someFunction Something.B.Bar =
|
||||||
|
let SomeThing.B.Bar = ()
|
||||||
|
in ()
|
||||||
""", """module ExposesSomeThings exposing (SomeOtherTypeAlias, exposedElement)
|
""", """module ExposesSomeThings exposing (SomeOtherTypeAlias, exposedElement)
|
||||||
type NonExposedCustomType = Variant
|
type NonExposedCustomType = Variant
|
||||||
type alias SomeOtherTypeAlias = {}
|
type alias SomeOtherTypeAlias = {}
|
||||||
@ -303,12 +307,17 @@ declarationVisitor node context =
|
|||||||
( [], { context | texts = context.texts ++ typeAnnotationNames context typeAnnotation } )
|
( [], { context | texts = context.texts ++ typeAnnotationNames context typeAnnotation } )
|
||||||
|
|
||||||
Declaration.FunctionDeclaration function ->
|
Declaration.FunctionDeclaration function ->
|
||||||
case function.signature |> Maybe.map (Node.value >> .typeAnnotation) of
|
let
|
||||||
Nothing ->
|
typeAnnotationTexts : List String
|
||||||
( [], context )
|
typeAnnotationTexts =
|
||||||
|
case function.signature |> Maybe.map (Node.value >> .typeAnnotation) of
|
||||||
|
Nothing ->
|
||||||
|
[]
|
||||||
|
|
||||||
Just typeAnnotation ->
|
Just typeAnnotation ->
|
||||||
( [], { context | texts = context.texts ++ typeAnnotationNames context typeAnnotation } )
|
typeAnnotationNames context typeAnnotation
|
||||||
|
in
|
||||||
|
( [], { context | texts = context.texts ++ typeAnnotationTexts } )
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
( [], context )
|
( [], context )
|
||||||
|
Loading…
Reference in New Issue
Block a user