• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  return 0;
53}
54@end
55// RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:47:16 %s | FileCheck -check-prefix=CC1 %s
56// 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:48:13 %s | FileCheck -check-prefix=CC2 %s
59// 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:49:13 %s | FileCheck -check-prefix=CC3 %s
62// 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:50:13 %s | FileCheck -check-prefix=CC4 %s
65// 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:51:9 %s | FileCheck -check-prefix=CC5 %s
68// CHECK-CC5: {TypedText setThisRecord:}{Placeholder (id)}{{.*}}(brief comment: This is Record)
69