mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-12-23 01:32:05 +03:00
Speed up scope_declarationEnterVisitor
This commit is contained in:
parent
e519b2b775
commit
5e4665dcbd
@ -6329,7 +6329,13 @@ scope_declarationEnterVisitor node context =
|
||||
{ context
|
||||
| lookupTable =
|
||||
ModuleNameLookupTableInternal.addMultiple
|
||||
(constructors |> ListExtra.orderIndependentConcatMap (Node.value >> .arguments) |> ListExtra.orderIndependentConcatMap (collectModuleNamesFromTypeAnnotation context))
|
||||
(List.foldl
|
||||
(\(Node _ constructor) acc ->
|
||||
collectModuleNamesFromTypeAnnotationHelp context constructor.arguments acc
|
||||
)
|
||||
[]
|
||||
constructors
|
||||
)
|
||||
context.lookupTable
|
||||
}
|
||||
|
||||
@ -6343,14 +6349,10 @@ scope_declarationEnterVisitor node context =
|
||||
|
||||
Declaration.PortDeclaration signature ->
|
||||
let
|
||||
moduleNamesFromSignature : List ( Range, ModuleName )
|
||||
moduleNamesFromSignature =
|
||||
collectModuleNamesFromTypeAnnotation context signature.typeAnnotation
|
||||
|
||||
lookupTable : ModuleNameLookupTable
|
||||
lookupTable =
|
||||
ModuleNameLookupTableInternal.addMultiple
|
||||
moduleNamesFromSignature
|
||||
(collectModuleNamesFromTypeAnnotation context signature.typeAnnotation)
|
||||
context.lookupTable
|
||||
in
|
||||
{ context | lookupTable = lookupTable }
|
||||
|
Loading…
Reference in New Issue
Block a user