Renaming
x
to xyz
inclass Bug {
def f(x: Int) = x
def g(a: Int, b: Int) = f(x = a) + b
}
results in the broken codeclass Bug {
def f(xyz: Int) = xyz
def g(a: Int, b: Int) = f(x = a) + b
}
if the renaming operation is initialized from f
. The same rename operation leads toclass Bug {
def f(x: Int) = x
def g(a: Int, b: Int) = f(x = a) xyz b
}
when initialized from the call to f
from g
. I know that this is a long standing issue, that is even mentioned in Mircos Master Thesis, and that fixing this might not be trivial, due to AST limitations. I also found this ticket, but I have no access to it.
Leave a comment
Well, for anyone who is interested in the progress I've made so far: The performance problems that lead to support for named parameters being dropped originally have already been fixed. Basic functionality is there, but handling for class parameters (especially case classes) is still missing. Also, the code that decides which tree was selected by the user needs some updates. More details can be found here: https://github.com/mlangc/scala-refactoring/tree/1002501-rename-does-not-consider-named-parameters
I'm on vacation this weekend, but I hope that I will find be able to push this further next week.
I'm on vacation this weekend, but I hope that I will find be able to push this further next week.
I've created a PR with the code I have so far, so that you can take a look early, as we discussed last Thursday: https://github.com/scala-ide/scala-refactoring/pull/141
I'm now at a stage where I'd like to have your feedback: https://github.com/scala-ide/scala-refactoring/pull/141
Correctly handle case classes owned by methods
This commit makes sure that case classes owned by methods are correctly handled
when doing rename refactorings.
Fix #1002501, Fix #1002572 together with the last commits
Branch: master
Commit: scala-ide:dd7ce5dd33
This commit makes sure that case classes owned by methods are correctly handled
when doing rename refactorings.
Fix #1002501, Fix #1002572 together with the last commits
Branch: master
Commit: scala-ide:dd7ce5dd33
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|