elm-tooling / tree-sitter-elm

Tree sitter implementation for elm
https://elm-tooling.github.io/tree-sitter-elm/
MIT License
75 stars 14 forks source link

Check parsing for MacCASOutreach/graphicsvg #15

Closed buinauskas closed 3 years ago

buinauskas commented 5 years ago

There are multiple failures from MacCASOutreach/graphicsvg

Have added the following to parse-examples:

checkout_at "examples/elm-graphicsvg" "MacCASOutreach/graphicsvg" "af01a9b1d7f80011e0239d8a7bed0115b759f7c9"

And I'm getting the following errors:

-----------------------------------------------------------------
examples/elm-graphicsvg/src/Tests/TransformationTests.elm               2 ms    (ERROR [52, 8] - [53, 43])
examples/elm-graphicsvg/src/GraphicSVG.elm                              12 ms   (ERROR [1829, 61] - [1935, 26])
examples/elm-graphicsvg/src/Templates/EllieApp/NotificationsApp.elm     0 ms    (ERROR [26, 8] - [26, 59])
examples/elm-graphicsvg/src/Templates/EllieApp/EllieAppWithTick.elm     0 ms    (ERROR [31, 8] - [31, 90])
examples/elm-graphicsvg/src/Templates/App/NotificationsApp.elm          0 ms    (ERROR [26, 8] - [26, 59])
examples/elm-graphicsvg/src/Templates/App/AppWithTick.elm               0 ms    (ERROR [46, 8] - [49, 43])
examples/elm-graphicsvg/src/GraphicSVG/Widget.elm                       1 ms    (ERROR [171, 20] - [171, 20]) 
-----------------------------------------------------------------

But I don't really get why it fails. It's perfectly valid and basic code. Any ideas?

For instance it complains about following update:


update : Msg -> Model -> Model
update msg model =
    case msg of 
        MakeBigger -> { model | radius = model.radius + 3 }
        MakeSmaller -> { model | radius = model.radius - 3 }
razzeee commented 5 years ago

The only thing that seems different here, is that there is no newline after ->, so maybe that's why. Most examples that we had so far have been formatted with elm format, this doesn't seem to be.

buinauskas commented 5 years ago

I'll see. Will write a test case for that. If formatting happens to be the issue, should this be fixed or language server expects elm-formated code?

razzeee commented 5 years ago

This should be fixed, as the compiler doesn't complain.

buinauskas commented 5 years ago

This is rather weird. I got a corpus test case for this one - it is working as expected. Tests indicate an error in 8th character of line, this being beginning of case statement branch.

razzeee commented 3 years ago

Closing, as we're down to one error from this package and that's fixable by running elm-format on it.