xcode refactor/rename should be able to introduce a parameter name

Originator:mayoff
Number:rdar://32697694 Date Originated:10-Jun-2017 11:01 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Version 9.0 beta (9M136h) / 10.13 Beta (17A264c)
Classification:UI/Usability Reproducible:Always
 
Summary:
Dear Xcoderinos,

The following description will be best understood if viewed in a monospaced font and with line wrapping.

import Cocoa

class MyView: NSView {

    required init?(coder: NSCoder) {
        super.init(coder: coder)
        /*                ↑
         I should be able to refactor/rename this variable. I'm talking about the identifier `coder` *after* the colon.

         The refactorizer doesn't let me rename it. I assume it recognizes that this is name is also used as the argument label, and that the argument label is inherited from NSView's declaration of this method. The argument label cannot be changed, because then this method would no longer override its superclass's method.

         The refactorifier should therefore rewrite the method declaration to include my desired parameter name separately.

         So, for example, if I ask to rename the variable to `decoder`, the refactorator should change the method declaration to:

             required init?(coder decoder: NSCoder)

         I also believe NSView's declaration of this method should just specify a parameter name of `decoder` in the first place. I will file a separate report for that. My request here is much more general, so please don't just punt this report over to AppKit.
         */
    }

}

Love,
Rob


Steps to Reproduce:
 

Expected Results:
 

Actual Results:
 

Version:
Version 9.0 beta (9M136h) / 10.13 Beta (17A264c)

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!