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
|
||||
VariantA -> ()
|
||||
(ExposesEverything.VariantA as foo) -> foo
|
||||
|
||||
someFunction Something.B.Bar =
|
||||
let SomeThing.B.Bar = ()
|
||||
in ()
|
||||
""", """module ExposesSomeThings exposing (SomeOtherTypeAlias, exposedElement)
|
||||
type NonExposedCustomType = Variant
|
||||
type alias SomeOtherTypeAlias = {}
|
||||
@ -303,12 +307,17 @@ declarationVisitor node context =
|
||||
( [], { context | texts = context.texts ++ typeAnnotationNames context typeAnnotation } )
|
||||
|
||||
Declaration.FunctionDeclaration function ->
|
||||
let
|
||||
typeAnnotationTexts : List String
|
||||
typeAnnotationTexts =
|
||||
case function.signature |> Maybe.map (Node.value >> .typeAnnotation) of
|
||||
Nothing ->
|
||||
( [], context )
|
||||
[]
|
||||
|
||||
Just typeAnnotation ->
|
||||
( [], { context | texts = context.texts ++ typeAnnotationNames context typeAnnotation } )
|
||||
typeAnnotationNames context typeAnnotation
|
||||
in
|
||||
( [], { context | texts = context.texts ++ typeAnnotationTexts } )
|
||||
|
||||
_ ->
|
||||
( [], context )
|
||||
|
Loading…
Reference in New Issue
Block a user