mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Retrieving local rename ranges and the local rename refactoring both had almost identical methods, except for the addition of retrieving the outermost shadowed decl that was added a couple months back. Merge them. Resolves rdar://106529370.
12 lines
702 B
Swift
12 lines
702 B
Swift
// RUN: %refactor -rename -dump-text -source-filename %s -pos=%(line+2):29 -new-name=renamed | %FileCheck %s --check-prefix=OPTIONAL
|
|
// OPTIONAL: shorthand_shadow.swift [[# @LINE+1]]:29 -> [[# @LINE+1]]:32
|
|
func renameShorthandBinding(opt: Int?) {
|
|
// RUN: %refactor -rename -dump-text -source-filename %s -pos=%(line+2):10 -new-name=renamed | %FileCheck %s --check-prefix=OPTIONAL
|
|
// OPTIONAL: shorthand_shadow.swift [[# @LINE+1]]:10 -> [[# @LINE+1]]:13
|
|
if let opt {
|
|
// RUN: %refactor -rename -dump-text -source-filename %s -pos=%(line+2):9 -new-name=renamed | %FileCheck %s --check-prefix=OPTIONAL
|
|
// OPTIONAL: shorthand_shadow.swift [[# @LINE+1]]:9 -> [[# @LINE+1]]:12
|
|
_ = opt
|
|
}
|
|
}
|