1// Note: the run lines follow their respective tests, since line/column numbers
2// matter in this test.
3// This test is for when property accessors do not have their own code 
4// completion comments. Use those in their properties in this case. 
5// 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 ];
52  p = self.GetterInClassExtension;
53  return 0; 
54}
55@end
56// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:47:16 %s | FileCheck -check-prefix=CHECK-CC1 %s
57// CHECK-CC1: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is ReadonlyProperty)
58
59// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:48:13 %s | FileCheck -check-prefix=CHECK-CC2 %s
60// CHECK-CC2: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension) 
61
62// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:49:13 %s | FileCheck -check-prefix=CHECK-CC3 %s
63// CHECK-CC3: {TypedText PropertyInPrimaryClass}{{.*}}(brief comment: This is PropertyInPrimaryClass)
64
65// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:50:13 %s | FileCheck -check-prefix=CHECK-CC4 %s
66// CHECK-CC4: {TypedText Record}{{.*}}(brief comment: This is Record)
67
68// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:51:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
69// CHECK-CC5: {TypedText setThisRecord:}{Placeholder (id)}{{.*}}(brief comment: This is Record)
70
71// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:52:12 %s | FileCheck -check-prefix=CHECK-CC6 %s
72// CHECK-CC6: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension) 
73
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=CHECK-CC7 %s
91// CHECK-CC7: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is getter = ReadonlyGetter) 
92
93