jfmengels / elm-review-simplify

Provides elm-review rules to simplify your Elm code
https://package.elm-lang.org/packages/jfmengels/elm-review-simplify/latest/
BSD 3-Clause "New" or "Revised" License
20 stars 9 forks source link

Add ImportLookup #84

Closed lue-bird closed 1 year ago

lue-bird commented 1 year ago

Implementing a lookup that helps figure out the module-local qualification for things https://github.com/jfmengels/elm-review-simplify/pull/82#discussion_r1096590841

Overall, this is great because you can be sure that fixes (like those of #82) will always produce valid code. (well except when a module has a member with the same name as an implicitly imported thing)

lue-bird commented 1 year ago

I hope existing code doesn't break since we now use Rule.withContextFromImportedModules (I don't think it changes the way the rule is run here but you know best).

jfmengels commented 1 year ago

I hope existing code doesn't break since we now use Rule.withContextFromImportedModules (I don't think it changes the way the rule is run here but you know best).

It won't in this case. That can only change the ProjectContext given to fromProjectToModule, where the previous context's fields were ignored anyway.

jfmengels commented 1 year ago

I'll merge this now, we can tackle the other comments later. Great work @lue-bird :heart: