Fariborz Jahanian | b98f7af | 2013-02-28 17:47:14 +0000 | [diff] [blame] | 1 | // Note: the run lines follow their respective tests, since line/column numbers |
| 2 | // matter in this test. |
Fariborz Jahanian | 809d1f1 | 2013-02-28 18:03:28 +0000 | [diff] [blame] | 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. |
Fariborz Jahanian | b98f7af | 2013-02-28 17:47:14 +0000 | [diff] [blame] | 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 ]; |
Fariborz Jahanian | c02ddb2 | 2013-03-22 17:55:27 +0000 | [diff] [blame] | 52 | p = self.GetterInClassExtension; |
Fariborz Jahanian | b98f7af | 2013-02-28 17:47:14 +0000 | [diff] [blame] | 53 | return 0; |
| 54 | } |
| 55 | @end |
Fariborz Jahanian | 809d1f1 | 2013-02-28 18:03:28 +0000 | [diff] [blame] | 56 | // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:47:16 %s | FileCheck -check-prefix=CC1 %s |
Fariborz Jahanian | b98f7af | 2013-02-28 17:47:14 +0000 | [diff] [blame] | 57 | // CHECK-CC1: {TypedText ReadonlyGetter}{{.*}}(brief comment: This is ReadonlyProperty) |
| 58 | |
Fariborz Jahanian | 809d1f1 | 2013-02-28 18:03:28 +0000 | [diff] [blame] | 59 | // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:48:13 %s | FileCheck -check-prefix=CC2 %s |
Fariborz Jahanian | b98f7af | 2013-02-28 17:47:14 +0000 | [diff] [blame] | 60 | // CHECK-CC2: {TypedText GetterInClassExtension}{{.*}}(brief comment: This is PropertyInClassExtension) |
| 61 | |
Fariborz Jahanian | 809d1f1 | 2013-02-28 18:03:28 +0000 | [diff] [blame] | 62 | // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:49:13 %s | FileCheck -check-prefix=CC3 %s |
Fariborz Jahanian | b98f7af | 2013-02-28 17:47:14 +0000 | [diff] [blame] | 63 | // CHECK-CC3: {TypedText PropertyInPrimaryClass}{{.*}}(brief comment: This is PropertyInPrimaryClass) |
| 64 | |
Fariborz Jahanian | 809d1f1 | 2013-02-28 18:03:28 +0000 | [diff] [blame] | 65 | // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:50:13 %s | FileCheck -check-prefix=CC4 %s |
Fariborz Jahanian | b98f7af | 2013-02-28 17:47:14 +0000 | [diff] [blame] | 66 | // CHECK-CC4: {TypedText Record}{{.*}}(brief comment: This is Record) |
| 67 | |
Fariborz Jahanian | 809d1f1 | 2013-02-28 18:03:28 +0000 | [diff] [blame] | 68 | // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:51:9 %s | FileCheck -check-prefix=CC5 %s |
Fariborz Jahanian | b98f7af | 2013-02-28 17:47:14 +0000 | [diff] [blame] | 69 | // CHECK-CC5: {TypedText setThisRecord:}{Placeholder (id)}{{.*}}(brief comment: This is Record) |
Fariborz Jahanian | c02ddb2 | 2013-03-22 17:55:27 +0000 | [diff] [blame] | 70 | |
| 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 Jahanian | 1686137 | 2013-03-23 01:10:45 +0000 | [diff] [blame] | 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 { |
| 87 | self.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 | |