Inline toRuleProjectVisitor

This commit is contained in:
Jeroen Engels 2023-06-03 00:45:57 +02:00
parent 7b9dded0b0
commit e2f4c68189

View File

@ -5621,7 +5621,7 @@ createRuleProjectVisitor schema initialProject ruleData initialCache =
RuleProjectVisitor
{ elmJsonVisitor = createProjectVisitor schema hidden schema.elmJsonVisitor ElmJsonStep ValidProject.elmJsonHash .elmJson (\entry -> raiseCache { cache | elmJson = Just entry }) (\() -> raise hidden)
, readmeVisitor = createProjectVisitor schema hidden schema.readmeVisitor ReadmeStep ValidProject.readmeHash .readme (\entry -> raiseCache { cache | readme = Just entry }) (\() -> raise hidden)
, extraFilesVisitor = createExtraFilesVisitor schema hidden raise (\entry -> raiseCache { cache | extraFiles = Just entry })
, extraFilesVisitor = createExtraFilesVisitor schema hidden raise raiseCache
, dependenciesVisitor = createDependenciesVisitor schema hidden.ruleData raiseCache cache { allVisitor = schema.dependenciesVisitor, directVisitor = schema.directDependenciesVisitor }
, createModuleVisitorFromProjectVisitor = createModuleVisitorFromProjectVisitor schema raiseCache hidden
, finalProjectEvaluation = createFinalProjectEvaluationVisitor schema hidden.ruleData raiseCache cache
@ -5721,14 +5721,14 @@ createExtraFilesVisitor :
ProjectRuleSchemaData projectContext moduleContext
-> RuleProjectVisitorHidden projectContext
-> ({ cache : ProjectRuleCache projectContext, ruleData : ChangeableRuleData } -> RuleProjectVisitor)
-> (ExtraFilesCache projectContext -> RuleProjectVisitor)
-> (ProjectRuleCache projectContext -> RuleProjectVisitor)
->
Maybe
(ValidProject
-> List { content : String, path : String }
-> ( List (Error {}), RuleProjectVisitor )
)
createExtraFilesVisitor schema hidden raise toRuleProjectVisitor =
createExtraFilesVisitor schema ({ cache } as hidden) raise raiseCache =
case schema.extraFilesVisitor of
Nothing ->
Nothing
@ -5764,15 +5764,18 @@ createExtraFilesVisitor schema hidden raise toRuleProjectVisitor =
errors : List (Error {})
errors =
filterExceptionsAndSetName hidden.ruleData.exceptions schema.name errorsForVisitor
entry : ExtraFilesCache projectContext
entry =
ExtraFile.create
{ contentHashes = contentHashes
, errors = errors
, inputContextHash = inputContextHash
, outputContext = outputContext
}
in
( errors
, ExtraFile.create
{ contentHashes = contentHashes
, errors = errors
, inputContextHash = inputContextHash
, outputContext = outputContext
}
|> toRuleProjectVisitor
, raiseCache { cache | extraFiles = Just entry }
)
)