brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · 0429b1d Raw
92 lines · plain
1// Note: the run lines follow their respective tests, since line/column numbers2// 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 6@interface AppDelegate7/**8  \brief This is ReadonlyProperty9*/10@property (readonly, getter = ReadonlyGetter) id MyProperty;11 12/**13  \brief This is GeneralProperty14*/15@property int GeneralProperty;16 17/**18  \brief This is PropertyInPrimaryClass19*/20@property (copy, nonatomic) id PropertyInPrimaryClass;21 22- (void) setThisRecord : (id)arg;23- (id) Record;24@end25 26 27@interface AppDelegate()28- (id) GetterInClassExtension;29/**30  \brief This is Record31*/32@property (copy, setter = setThisRecord:) id Record;33@end34 35@interface AppDelegate()36/**37  \brief This is PropertyInClassExtension38*/39@property (copy, getter = GetterInClassExtension) id PropertyInClassExtension;40 41- (id) PropertyInPrimaryClass;42@end43  44@implementation AppDelegate45- (id) PropertyInPrimaryClass { 46  id p = [self ReadonlyGetter];47  p = [self GetterInClassExtension];48  p = [self PropertyInPrimaryClass];49  p = [self Record];50  [self setThisRecord : (id)0 ];51  p = self.GetterInClassExtension;52  return 0; 53}54@end55// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:46:16 %s | FileCheck -check-prefix=CHECK-CC1 %s56// CHECK-CC1: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is ReadonlyProperty)57 58// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:47:13 %s | FileCheck -check-prefix=CHECK-CC2 %s59// CHECK-CC2: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension) 60 61// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:48:13 %s | FileCheck -check-prefix=CHECK-CC3 %s62// CHECK-CC3: {TypedText PropertyInPrimaryClass}{{.*}}(brief comment: This is PropertyInPrimaryClass)63 64// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:49:13 %s | FileCheck -check-prefix=CHECK-CC4 %s65// CHECK-CC4: {TypedText Record}{{.*}}(brief comment: This is Record)66 67// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:50:9 %s | FileCheck -check-prefix=CHECK-CC5 %s68// CHECK-CC5: {TypedText setThisRecord:}{Placeholder (id)}{{.*}}(brief comment: This is Record)69 70// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:51:12 %s | FileCheck -check-prefix=CHECK-CC6 %s71// CHECK-CC6: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension) 72 73@interface AnotherAppDelegate74/**75  \brief This is ReadonlyProperty76*/77@property (getter = ReadonlyGetter) int MyProperty;78/**79  \brief This is getter = ReadonlyGetter80*/81- (int) ReadonlyGetter;82@end83 84@implementation AnotherAppDelegate85- (int) PropertyInPrimaryClass { 86self.ReadonlyGetter;87}88@end89// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:86:6 %s | FileCheck -check-prefix=CHECK-CC7 %s90// CHECK-CC7: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is getter = ReadonlyGetter) 91 92