mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This allows building sourcekitd and swift-refactor with `SWIFT_BUILD_SWIFT_SYNTAX=NO`. In these builds, the `relatedidents` and `find-syntactic-rename-ranges` requests will always return an error.
13 lines
623 B
Swift
13 lines
623 B
Swift
// REQUIRES: swift_swift_parser
|
|
// RUN: %refactor -find-local-rename-ranges -source-filename %s -pos=%(line+2):29 | %FileCheck %s --check-prefix=OPTIONAL
|
|
// OPTIONAL: func renameShorthandBinding(<base>opt</base>: Int?) {
|
|
func renameShorthandBinding(opt: Int?) {
|
|
// RUN: %refactor -find-local-rename-ranges -source-filename %s -pos=%(line+2):10 | %FileCheck %s --check-prefix=OPTIONAL
|
|
// OPTIONAL: if let <base>opt</base> {
|
|
if let opt {
|
|
// RUN: %refactor -find-local-rename-ranges -source-filename %s -pos=%(line+2):9 | %FileCheck %s --check-prefix=OPTIONAL
|
|
// OPTIONAL: _ = <base>opt</base>
|
|
_ = opt
|
|
}
|
|
}
|