jwoudenberg / elm-pair

An artificial pair-programmer that helps you write Elm
https://elm-pair.com
GNU General Public License v3.0
109 stars 0 forks source link

Renaming false positive (renaming parameter of one function mistakenly renames parameter of other function) #21

Closed Janiczek closed 2 years ago

Janiczek commented 2 years ago

This isn't a runnable SSCCE but roughly what's happening:

fun1 ctx = ...
fun2 context = ...

:arrow_down: rename context in fun2 to ctx

fun1 ctx2 = ... -- bug
fun2 ctx = ...

This is happening on main as of d0b5f29de20a70e009578b7735d8ac8ad9481036.

Seems like these two parameters are unrelated, so we shouldn't be renaming one when changing the other.

https://user-images.githubusercontent.com/149425/162218763-3410b326-2dbf-41c5-a264-ad7b93acdb64.mp4

jwoudenberg commented 2 years ago

Looks like maybe a regression I introduced in today's release. I definitely agree the rename shouldn't happen. Thank you for the clear bug report, I'll look into this first thing tomorrow!

jwoudenberg commented 2 years ago

Fixed in release 16, which is now live!

rec

For what it's worth, I don't think this was a regression, and that the problem already existed earlier.

Thank you for letting me know about this bug!

Janiczek commented 2 years ago

Thanks for being so quick about these fixes, @jwoudenberg !