1 // Test is line- and column-sensitive. Run lines are below
11 /// Base property docs
12 @property struct Foo baseProperty;
15 - (void)baseMethodWithArg:(int)arg;
20 /// Protocol property docs
21 @property struct Foo protocolProperty;
25 @interface Derived: Base
26 /// Derived method docs
27 - (void)derivedMethodWithValue:(id<Protocol>)value;
30 @implementation Derived
31 - (void)derivedMethodWithValue:(id<Protocol>)value {
36 // RUN: c-index-test -single-symbol-sgf-at=%s:4:9 local %s | FileCheck -check-prefix=CHECK-FOO %s
37 // CHECK-FOO: "parentContexts":[{"kind":"objective-c.struct","name":"Foo","usr":"c:@S@Foo"}]
38 // CHECK-FOO: "relatedSymbols":[]
39 // CHECK-FOO: "relationships":[]
40 // CHECK-FOO: "text":"Foo docs"
41 // CHECK-FOO: "kind":{"displayName":"Structure","identifier":"objective-c.struct"}
42 // CHECK-FOO: "title":"Foo"
44 // RUN: c-index-test -single-symbol-sgf-at=%s:6:9 local %s | FileCheck -check-prefix=CHECK-BAR %s
45 // CHECK-BAR: "parentContexts":[{"kind":"objective-c.struct","name":"Foo","usr":"c:@S@Foo"},{"kind":"objective-c.property","name":"bar","usr":"c:@S@Foo@FI@bar"}]
46 // CHECK-BAR: "relatedSymbols":[]
47 // CHECK-BAR: "relationships":[{"kind":"memberOf","source":"c:@S@Foo@FI@bar","target":"c:@S@Foo"
48 // CHECK-BAR: "text":"Bar docs"
49 // CHECK-BAR: "kind":{"displayName":"Instance Property","identifier":"objective-c.property"}
50 // CHECK-BAR: "title":"bar"
52 // RUN: c-index-test -single-symbol-sgf-at=%s:10:11 local %s | FileCheck -check-prefix=CHECK-BASE %s
53 // CHECK-BASE: "parentContexts":[{"kind":"objective-c.class","name":"Base","usr":"c:objc(cs)Base"}]
54 // CHECK-BASE: "relatedSymbols":[]
55 // CHECK-BASE: "relationships":[]
56 // CHECK-BASE: "text":"Base docs"
57 // CHECK-BASE: "kind":{"displayName":"Class","identifier":"objective-c.class"}
58 // CHECK-BASE: "title":"Base"
60 // RUN: c-index-test -single-symbol-sgf-at=%s:12:25 local %s | FileCheck -check-prefix=CHECK-BASE-PROP %s
61 // CHECK-BASE-PROP: "parentContexts":[{"kind":"objective-c.class","name":"Base","usr":"c:objc(cs)Base"},{"kind":"objective-c.property","name":"baseProperty","usr":"c:objc(cs)Base(py)baseProperty"}]
62 // CHECK-BASE-PROP: "relatedSymbols":[{"accessLevel":"public","declarationLanguage":"objective-c"
63 // CHECK-BASE-PROP: "isSystem":false
64 // CHECK-BASE-PROP: "usr":"c:@S@Foo"}]
65 // CHECK-BASE-PROP: "relationships":[{"kind":"memberOf","source":"c:objc(cs)Base(py)baseProperty","target":"c:objc(cs)Base"
66 // CHECK-BASE-PROP: "text":"Base property docs"
67 // CHECK-BASE-PROP: "kind":{"displayName":"Instance Property","identifier":"objective-c.property"}
68 // CHECK-BASE-PROP: "title":"baseProperty"
70 // RUN: c-index-test -single-symbol-sgf-at=%s:15:9 local %s | FileCheck -check-prefix=CHECK-BASE-METHOD %s
71 // CHECK-BASE-METHOD: "parentContexts":[{"kind":"objective-c.class","name":"Base","usr":"c:objc(cs)Base"},{"kind":"objective-c.method","name":"baseMethodWithArg:","usr":"c:objc(cs)Base(im)baseMethodWithArg:"}]
72 // CHECK-BASE-METHOD: "relatedSymbols":[]
73 // CHECK-BASE-METHOD: "relationships":[{"kind":"memberOf","source":"c:objc(cs)Base(im)baseMethodWithArg:","target":"c:objc(cs)Base"
74 // CHECK-BASE-METHOD: "text":"Base method docs"
75 // CHECK-BASE-METHOD: "kind":{"displayName":"Instance Method","identifier":"objective-c.method"}
76 // CHECK-BASE-METHOD: "title":"baseMethodWithArg:"
78 // RUN: c-index-test -single-symbol-sgf-at=%s:19:11 local %s | FileCheck -check-prefix=CHECK-PROTOCOL %s
79 // CHECK-PROTOCOL: "parentContexts":[{"kind":"objective-c.protocol","name":"Protocol","usr":"c:objc(pl)Protocol"}]
80 // CHECK-PROTOCOL: "relatedSymbols":[]
81 // CHECK-PROTOCOL: "relationships":[]
82 // CHECK-PROTOCOL: "text":"Protocol docs"
83 // CHECK-PROTOCOL: "kind":{"displayName":"Protocol","identifier":"objective-c.protocol"}
84 // CHECK-PROTOCOL: "title":"Protocol"
86 // RUN: c-index-test -single-symbol-sgf-at=%s:21:27 local %s | FileCheck -check-prefix=CHECK-PROTOCOL-PROP %s
87 // CHECK-PROTOCOL-PROP: "parentContexts":[{"kind":"objective-c.protocol","name":"Protocol","usr":"c:objc(pl)Protocol"},{"kind":"objective-c.property","name":"protocolProperty","usr":"c:objc(pl)Protocol(py)protocolProperty"}]
88 // CHECK-PROTOCOL-PROP: "relatedSymbols":[{"accessLevel":"public","declarationLanguage":"objective-c"
89 // CHECK-PROTOCOL-PROP: "isSystem":false
90 // CHECK-PROTOCOL-PROP: "usr":"c:@S@Foo"}]
91 // CHECK-PROTOCOL-PROP: "relationships":[{"kind":"memberOf","source":"c:objc(pl)Protocol(py)protocolProperty","target":"c:objc(pl)Protocol"
92 // CHECK-PROTOCOL-PROP: "text":"Protocol property docs"
93 // CHECK-PROTOCOL-PROP: "kind":{"displayName":"Instance Property","identifier":"objective-c.property"}
94 // CHECK-PROTOCOL-PROP: "title":"protocolProperty"
96 // RUN: c-index-test -single-symbol-sgf-at=%s:25:15 local %s | FileCheck -check-prefix=CHECK-DERIVED %s
97 // CHECK-DERIVED: "parentContexts":[{"kind":"objective-c.class","name":"Derived","usr":"c:objc(cs)Derived"}]
98 // CHECK-DERIVED: "relatedSymbols":[{"accessLevel":"public","declarationLanguage":"objective-c"
99 // CHECK-DERIVED: "isSystem":false
100 // CHECK-DERIVED: "usr":"c:objc(cs)Base"}]
101 // CHECK-DERIVED: "relationships":[{"kind":"inheritsFrom","source":"c:objc(cs)Derived","target":"c:objc(cs)Base"
102 // CHECK-DERIVED: "text":"Derived docs"
103 // CHECK-DERIVED: "kind":{"displayName":"Class","identifier":"objective-c.class"}
104 // CHECK-DERIVED: "title":"Derived"
106 // RUN: c-index-test -single-symbol-sgf-at=%s:27:11 local %s | FileCheck -check-prefix=CHECK-DERIVED-METHOD %s
107 // CHECK-DERIVED-METHOD: "parentContexts":[{"kind":"objective-c.class","name":"Derived","usr":"c:objc(cs)Derived"},{"kind":"objective-c.method","name":"derivedMethodWithValue:","usr":"c:objc(cs)Derived(im)derivedMethodWithValue:"}]
108 // CHECK-DERIVED-METHOD: "relatedSymbols":[]
109 // CHECK-DERIVED-METHOD: "relationships":[{"kind":"memberOf","source":"c:objc(cs)Derived(im)derivedMethodWithValue:","target":"c:objc(cs)Derived"
110 // CHECK-DERIVED-METHOD: "text":"Derived method docs"
111 // CHECK-DERIVED-METHOD: "kind":{"displayName":"Instance Method","identifier":"objective-c.method"}
112 // CHECK-DERIVED-METHOD: "title":"derivedMethodWithValue:"
114 // RUN: c-index-test -single-symbol-sgf-at=%s:31:11 local %s | FileCheck -check-prefix=CHECK-DERIVED-METHOD-IMPL %s
115 // CHECK-DERIVED-METHOD-IMPL: "parentContexts":[{"kind":"objective-c.class","name":"Derived","usr":"c:objc(cs)Derived"},{"kind":"objective-c.method","name":"derivedMethodWithValue:","usr":"c:objc(cs)Derived(im)derivedMethodWithValue:"}]
116 // CHECK-DERIVED-METHOD-IMPL: "relatedSymbols":[]
117 // CHECK-DERIVED-METHOD-IMPL: "relationships":[{"kind":"memberOf","source":"c:objc(cs)Derived(im)derivedMethodWithValue:","target":"c:objc(cs)Derived"
118 // CHECK-DERIVED-METHOD-IMPL: "text":"Derived method docs"
119 // CHECK-DERIVED-METHOD-IMPL: "kind":{"displayName":"Instance Method","identifier":"objective-c.method"}
120 // CHECK-DERIVED-METHOD-IMPL: "title":"derivedMethodWithValue:"