elm / error-message-catalog

A catalog of broken Elm programs / data to improve error messages
BSD 3-Clause "New" or "Revised" License
173 stars 17 forks source link

Suggest longer names with same prefix on naming errors #299

Open robx opened 5 years ago

robx commented 5 years ago

Quick Summary:

Elm generally does a great job suggesting alternate names when you've misspelled a word. I just came across a case where this could easily be improved:

I tried using String.drop, while String.dropLeft was what I needed.

-- NAMING ERROR ------------------------------------------------- src/Tweets.elm

I cannot find a `String.drop` variable:

285|                             [ Url.Builder.string "user_screen_name" <| "eq." ++ String.drop 1 author ]
                                                                                     ^^^^^^^^^^^
The `String` module does not expose a `drop` variable. These names seem close
though:

    String.map
    String.trim
    String.all
    String.any

Hint: Read <https://elm-lang.org/0.19.0/imports> to see how `import`
declarations work in Elm.