Remove moduleToDependency from Project

This commit is contained in:
Jeroen Engels 2020-02-15 10:16:40 +01:00
parent 2016640367
commit 8cb2453bfc

View File

@ -63,7 +63,6 @@ type Project
, filesThatFailedToParse : List { path : String, source : String } , filesThatFailedToParse : List { path : String, source : String }
, elmJson : Maybe { path : String, raw : String, project : Elm.Project.Project } , elmJson : Maybe { path : String, raw : String, project : Elm.Project.Project }
, dependencyModules : Dict String Elm.Docs.Module , dependencyModules : Dict String Elm.Docs.Module
, moduleToDependency : Dict String String
, moduleGraph : Maybe (Graph ModuleName ()) , moduleGraph : Maybe (Graph ModuleName ())
} }
@ -77,7 +76,6 @@ new =
, filesThatFailedToParse = [] , filesThatFailedToParse = []
, elmJson = Nothing , elmJson = Nothing
, dependencyModules = Dict.empty , dependencyModules = Dict.empty
, moduleToDependency = Dict.empty
, moduleGraph = Nothing , moduleGraph = Nothing
} }
@ -324,13 +322,6 @@ withDependency dependency (Project project) =
|> List.map (\module_ -> ( module_.name, module_ )) |> List.map (\module_ -> ( module_.name, module_ ))
|> Dict.fromList |> Dict.fromList
) )
, moduleToDependency =
Dict.union
project.moduleToDependency
(dependency.modules
|> List.map (\module_ -> ( module_.name, dependency.packageName ))
|> Dict.fromList
)
} }
|> recomputeModuleGraphIfNeeded |> recomputeModuleGraphIfNeeded
@ -340,11 +331,7 @@ a project when they are changed, before re-adding them.
-} -}
removeDependencies : Project -> Project removeDependencies : Project -> Project
removeDependencies (Project project) = removeDependencies (Project project) =
Project Project { project | dependencyModules = Dict.empty }
{ project
| dependencyModules = Dict.empty
, moduleToDependency = Dict.empty
}
|> recomputeModuleGraphIfNeeded |> recomputeModuleGraphIfNeeded