mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-12-23 09:42:49 +03:00
Speed up scope_declarationEnterVisitor
This commit is contained in:
parent
e519b2b775
commit
5e4665dcbd
@ -6329,7 +6329,13 @@ scope_declarationEnterVisitor node context =
|
|||||||
{ context
|
{ context
|
||||||
| lookupTable =
|
| lookupTable =
|
||||||
ModuleNameLookupTableInternal.addMultiple
|
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
|
context.lookupTable
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6343,14 +6349,10 @@ scope_declarationEnterVisitor node context =
|
|||||||
|
|
||||||
Declaration.PortDeclaration signature ->
|
Declaration.PortDeclaration signature ->
|
||||||
let
|
let
|
||||||
moduleNamesFromSignature : List ( Range, ModuleName )
|
|
||||||
moduleNamesFromSignature =
|
|
||||||
collectModuleNamesFromTypeAnnotation context signature.typeAnnotation
|
|
||||||
|
|
||||||
lookupTable : ModuleNameLookupTable
|
lookupTable : ModuleNameLookupTable
|
||||||
lookupTable =
|
lookupTable =
|
||||||
ModuleNameLookupTableInternal.addMultiple
|
ModuleNameLookupTableInternal.addMultiple
|
||||||
moduleNamesFromSignature
|
(collectModuleNamesFromTypeAnnotation context signature.typeAnnotation)
|
||||||
context.lookupTable
|
context.lookupTable
|
||||||
in
|
in
|
||||||
{ context | lookupTable = lookupTable }
|
{ context | lookupTable = lookupTable }
|
||||||
|
Loading…
Reference in New Issue
Block a user