blob: 774a02021e742bd31bb532d99933cae8f6f7cc61 [file] [log] [blame]
Fariborz Jahanianb98f7af2013-02-28 17:47:14 +00001// Note: the run lines follow their respective tests, since line/column numbers
2// matter in this test.
Fariborz Jahanian809d1f12013-02-28 18:03:28 +00003// This test is for when property accessors do not have their own code
4// completion comments. Use those in their properties in this case.
Fariborz Jahanianb98f7af2013-02-28 17:47:14 +00005// rdar://12791315
6
7@interface AppDelegate
8/**
9 \brief This is ReadonlyProperty
10*/
11@property (readonly, getter = ReadonlyGetter) id MyProperty;
12
13/**
14 \brief This is GeneralProperty
15*/
16@property int GeneralProperty;
17
18/**
19 \brief This is PropertyInPrimaryClass
20*/
21@property (copy, nonatomic) id PropertyInPrimaryClass;
22
23- (void) setThisRecord : (id)arg;
24- (id) Record;
25@end
26
27
28@interface AppDelegate()
29- (id) GetterInClassExtension;
30/**
31 \brief This is Record
32*/
33@property (copy, setter = setThisRecord:) id Record;
34@end
35
36@interface AppDelegate()
37/**
38 \brief This is PropertyInClassExtension
39*/
40@property (copy, getter = GetterInClassExtension) id PropertyInClassExtension;
41
42- (id) PropertyInPrimaryClass;
43@end
44
45@implementation AppDelegate
46- (id) PropertyInPrimaryClass {
47 id p = [self ReadonlyGetter];
48 p = [self GetterInClassExtension];
49 p = [self PropertyInPrimaryClass];
50 p = [self Record];
51 [self setThisRecord : (id)0 ];
Fariborz Jahanianc02ddb22013-03-22 17:55:27 +000052 p = self.GetterInClassExtension;
Fariborz Jahanianb98f7af2013-02-28 17:47:14 +000053 return 0;
54}
55@end
Fariborz Jahanian809d1f12013-02-28 18:03:28 +000056// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:47:16 %s | FileCheck -check-prefix=CC1 %s
Fariborz Jahanianb98f7af2013-02-28 17:47:14 +000057// CHECK-CC1: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is ReadonlyProperty)
58
Fariborz Jahanian809d1f12013-02-28 18:03:28 +000059// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:48:13 %s | FileCheck -check-prefix=CC2 %s
Fariborz Jahanianb98f7af2013-02-28 17:47:14 +000060// CHECK-CC2: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension)
61
Fariborz Jahanian809d1f12013-02-28 18:03:28 +000062// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:49:13 %s | FileCheck -check-prefix=CC3 %s
Fariborz Jahanianb98f7af2013-02-28 17:47:14 +000063// CHECK-CC3: {TypedText PropertyInPrimaryClass}{{.*}}(brief comment: This is PropertyInPrimaryClass)
64
Fariborz Jahanian809d1f12013-02-28 18:03:28 +000065// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:50:13 %s | FileCheck -check-prefix=CC4 %s
Fariborz Jahanianb98f7af2013-02-28 17:47:14 +000066// CHECK-CC4: {TypedText Record}{{.*}}(brief comment: This is Record)
67
Fariborz Jahanian809d1f12013-02-28 18:03:28 +000068// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:51:9 %s | FileCheck -check-prefix=CC5 %s
Fariborz Jahanianb98f7af2013-02-28 17:47:14 +000069// CHECK-CC5: {TypedText setThisRecord:}{Placeholder (id)}{{.*}}(brief comment: This is Record)
Fariborz Jahanianc02ddb22013-03-22 17:55:27 +000070
71// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:52:12 %s | FileCheck -check-prefix=CC6 %s
72// CHECK-CC6: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension)
Fariborz Jahanian16861372013-03-23 01:10:45 +000073
74@interface AnotherAppDelegate
75/**
76 \brief This is ReadonlyProperty
77*/
78@property (getter = ReadonlyGetter) int MyProperty;
79/**
80 \brief This is getter = ReadonlyGetter
81*/
82- (int) ReadonlyGetter;
83@end
84
85@implementation AnotherAppDelegate
86- (int) PropertyInPrimaryClass {
87self.ReadonlyGetter;
88}
89@end
90// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:87:6 %s | FileCheck -check-prefix=CC7 %s
91// CHECK-CC7: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is getter = ReadonlyGetter)
92