-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathtextual.swift
43 lines (39 loc) · 1.41 KB
/
textual.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
/*foo:unknown*/foo() is not /*foo:unknown*/foo(first:)
*/
/// This describes /*foo:unknown*/foo and /*foo:unknown*/foo
func /*foo:def*/foo() {
let /*foo:def*/foo = "Here is /*foo:unknown*/foo"
// /*foo:unknown*/foo's return
#selector(Struct . /*foo:unknown*/foo(_:aboveSubview:))
#selector(/*foo:unknown*/foo(_:))
#selector(#selector(/*foo:unknown*/foo))
#if true
/*foo*/foo = 2
/*foo*/foo()
/*foo:call*/foo()
/*foo:unknown*/foo = 3
/*foo:unknown*/foo()
#if false
/*foo:unknown*/foo += 2
/*foo:unknown*/foo()
#endif
#else
/*foo:unknown*/foo = 4
#endif
return 1
}
#if false
class /*MyClass:unknown*/MyClass {}
_ = /*MyClass:unknown*/Mismatch()
_ = /*MyClass:unknown*/MyClass()
#else
class /*MyClass:unknown*/MyClass {}
_ = /*MyClass:unknown*/Mismatch()
_ = /*MyClass:unknown*/MyClass()
#endif
// RUN: %empty-directory(%t.ranges)
// RUN: %refactor -find-rename-ranges -source-filename %s -pos="foo" -is-function-like -old-name "foo" >> %t.ranges/textual_foo.swift
// RUN: diff -u %S/Outputs/textual/foo.swift.expected %t.ranges/textual_foo.swift
// RUN: %refactor -find-rename-ranges -source-filename %s -pos="MyClass" -is-non-protocol-type -old-name "MyClass" -new-name "YourClass" >> %t.ranges/textual_MyClass.swift
// RUN: diff -u %S/Outputs/textual/MyClass.swift.expected %t.ranges/textual_MyClass.swift