diff --git a/demo/Main.elm b/demo/Main.elm index ab5f589f..cf0f2493 100644 --- a/demo/Main.elm +++ b/demo/Main.elm @@ -10,7 +10,7 @@ import NoUnused.Variables import Reporter import Review import Review.File exposing (RawFile) -import Review.Project as Project +import Review.Project as Project exposing (Project) import Review.Rule as Rule exposing (Rule) @@ -33,6 +33,7 @@ main = type alias Model = { sourceCode : String + , project : Project , reviewErrors : List Rule.Error , noDebugEnabled : Bool , noUnusedVariablesEnabled : Bool @@ -66,6 +67,7 @@ g n = n + 1 """ in { sourceCode = sourceCode + , project = Project.withModule (file sourceCode) Project.new , reviewErrors = [] , noDebugEnabled = True , noUnusedVariablesEnabled = True @@ -105,7 +107,10 @@ update : Msg -> Model -> Model update action model = case action of UserEditedSourceCode sourceCode -> - { model | sourceCode = sourceCode } + { model + | sourceCode = sourceCode + , project = Project.withModule (file sourceCode) model.project + } |> runReview UserToggledNoDebugRule -> @@ -126,7 +131,11 @@ update action model = runReview : Model -> Model runReview model = - { model | reviewErrors = Review.reviewRawFiles (config model) Project.new [ file model.sourceCode ] } + { model + | reviewErrors = + Review.review (config model) model.project + |> Tuple.first + } diff --git a/demo/elm.json b/demo/elm.json index 508d3fac..7da7449f 100644 --- a/demo/elm.json +++ b/demo/elm.json @@ -14,10 +14,13 @@ "elm/core": "1.0.2", "elm/html": "1.0.0", "elm/project-metadata-utils": "1.0.0", + "elm-community/graph": "6.0.0", + "elm-community/intdict": "3.0.0", "jinjor/elm-diff": "1.0.6", "stil4m/elm-syntax": "7.1.0" }, "indirect": { + "avh4/elm-fifo": "1.0.4", "elm/json": "1.1.3", "elm/parser": "1.1.0", "elm/time": "1.0.0", @@ -34,4 +37,4 @@ "direct": {}, "indirect": {} } -} \ No newline at end of file +}