diff options
| author | Sam McCall <sam.mccall@gmail.com> | 2018-11-20 22:06:54 +0000 |
|---|---|---|
| committer | Sam McCall <sam.mccall@gmail.com> | 2018-11-20 22:06:54 +0000 |
| commit | 8e9baa3f17c8e54906cbffbede6f9587fe01a8c3 (patch) | |
| tree | e7064f6fbf26af6b7caebb73adfe9e04c2e900c0 /clang/test/Index | |
| parent | 435c739fbe618e0232ca4e9ec3cc971f8adbd1e1 (diff) | |
| download | bcm5719-llvm-8e9baa3f17c8e54906cbffbede6f9587fe01a8c3.tar.gz bcm5719-llvm-8e9baa3f17c8e54906cbffbede6f9587fe01a8c3.zip | |
[CodeComplete] Penalize inherited ObjC properties for auto-completion
Summary:
Similar to auto-completion for ObjC methods, inherited properties
should be penalized / direct class and category properties should
be prioritized.
Note that currently, the penalty for using a result from a base class
(CCD_InBaseClass) is equal to the penalty for using a method as a
property (CCD_MethodAsProperty).
Reviewers: jkorous, sammccall, akyrtzi, arphaman, benlangmuir
Reviewed By: sammccall, akyrtzi
Subscribers: arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D53900
llvm-svn: 347352
Diffstat (limited to 'clang/test/Index')
| -rw-r--r-- | clang/test/Index/complete-block-properties.m | 12 | ||||
| -rw-r--r-- | clang/test/Index/complete-block-property-assignment.m | 14 | ||||
| -rw-r--r-- | clang/test/Index/complete-member-access.m | 8 | ||||
| -rw-r--r-- | clang/test/Index/complete-properties.m | 22 |
4 files changed, 28 insertions, 28 deletions
diff --git a/clang/test/Index/complete-block-properties.m b/clang/test/Index/complete-block-properties.m index a754712e4c9..0e8872dece2 100644 --- a/clang/test/Index/complete-block-properties.m +++ b/clang/test/Index/complete-block-properties.m @@ -40,15 +40,15 @@ typedef int (^BarBlock)(int *); // RUN: c-index-test -code-completion-at=%s:35:33 %s | FileCheck -check-prefix=CHECK-CC1 %s // RUN: c-index-test -code-completion-at=%s:36:21 %s | FileCheck -check-prefix=CHECK-CC1 %s //CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText barBlock}{LeftParen (}{Placeholder int *}{RightParen )} (35) -//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void}{TypedText block}{LeftParen (}{RightParen )} (35) -//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void (^)()}{TypedText block}{Equal = }{Placeholder ^(void)} (38) -//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType Foo}{TypedText blocker}{LeftParen (}{Placeholder int x}{Comma , }{Placeholder Foo y}{Comma , }{Placeholder ^(Foo *someParameter)foo}{RightParen )} (35) -//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType Foo (^)(int, Foo, FooBlock)}{TypedText blocker}{Equal = }{Placeholder ^Foo(int x, Foo y, FooBlock foo)} (32) +//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void}{TypedText block}{LeftParen (}{RightParen )} (37) +//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void (^)()}{TypedText block}{Equal = }{Placeholder ^(void)} (40) +//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType Foo}{TypedText blocker}{LeftParen (}{Placeholder int x}{Comma , }{Placeholder Foo y}{Comma , }{Placeholder ^(Foo *someParameter)foo}{RightParen )} (37) +//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType Foo (^)(int, Foo, FooBlock)}{TypedText blocker}{Equal = }{Placeholder ^Foo(int x, Foo y, FooBlock foo)} (34) //CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText foo} (35) //CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void}{TypedText fooBlock}{LeftParen (}{Placeholder Foo *someParameter}{RightParen )} (35) //CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType Test *}{TypedText getObject}{LeftParen (}{Placeholder int index}{RightParen )} (35) -//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText performA}{LeftParen (}{RightParen )} (35) -//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText performB}{LeftParen (}{Placeholder int x}{Comma , }{Placeholder int y}{RightParen )} (35) +//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText performA}{LeftParen (}{RightParen )} (37) +//CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText performB}{LeftParen (}{Placeholder int x}{Comma , }{Placeholder int y}{RightParen )} (37) @end diff --git a/clang/test/Index/complete-block-property-assignment.m b/clang/test/Index/complete-block-property-assignment.m index 48b6aea3a67..c1abc03ad06 100644 --- a/clang/test/Index/complete-block-property-assignment.m +++ b/clang/test/Index/complete-block-property-assignment.m @@ -34,10 +34,10 @@ typedef void (^FooBlock)(Foo *someParameter); // RUN: c-index-test -code-completion-at=%s:28:27 %s | FileCheck -check-prefix=CHECK-CC1 %s // RUN: c-index-test -code-completion-at=%s:29:22 %s | FileCheck -check-prefix=CHECK-CC1 %s // RUN: c-index-test -code-completion-at=%s:30:9 %s | FileCheck -check-prefix=CHECK-CC1 %s -// CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText foo} (35) +// CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText foo} (37) // CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType Obj *}{TypedText obj} (35) -// CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void}{TypedText onAction}{LeftParen (}{Placeholder Obj *object}{RightParen )} (35) -// CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void (^)(Obj *)}{TypedText onAction}{Equal = }{Placeholder ^(Obj *object)} (38) +// CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void}{TypedText onAction}{LeftParen (}{Placeholder Obj *object}{RightParen )} (37) +// CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void (^)(Obj *)}{TypedText onAction}{Equal = }{Placeholder ^(Obj *object)} (40) // CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void}{TypedText onEventHandler}{LeftParen (}{Placeholder Foo *someParameter}{RightParen )} (35) // CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType FooBlock}{TypedText onEventHandler}{Equal = }{Placeholder ^(Foo *someParameter)} (38) // CHECK-CC1-NEXT: ObjCPropertyDecl:{ResultType void}{TypedText onReadonly}{LeftParen (}{Placeholder int *someParameter}{RightParen )} (35) @@ -61,17 +61,17 @@ typedef void (^FooBlock)(Foo *someParameter); // RUN: c-index-test -code-completion-at=%s:52:23 %s | FileCheck -check-prefix=CHECK-NO %s // RUN: c-index-test -code-completion-at=%s:53:12 %s | FileCheck -check-prefix=CHECK-NO %s // RUN: c-index-test -code-completion-at=%s:56:15 %s | FileCheck -check-prefix=CHECK-NO %s -// CHECK-NO: ObjCPropertyDecl:{ResultType int}{TypedText foo} (35) +// CHECK-NO: ObjCPropertyDecl:{ResultType int}{TypedText foo} (37) // CHECK-NO-NEXT: ObjCPropertyDecl:{ResultType Obj *}{TypedText obj} (35) -// CHECK-NO-NEXT: ObjCPropertyDecl:{ResultType void (^)(Obj *)}{TypedText onAction} (35) +// CHECK-NO-NEXT: ObjCPropertyDecl:{ResultType void (^)(Obj *)}{TypedText onAction} (37) // CHECK-NO-NEXT: ObjCPropertyDecl:{ResultType FooBlock}{TypedText onEventHandler} (35) // CHECK-NO-NEXT: ObjCPropertyDecl:{ResultType void (^)(int *)}{TypedText onReadonly} (35) // CHECK-NO-NEXT: ObjCPropertyDecl:{ResultType int (^)(int)}{TypedText processEvent} (35) // RUN: c-index-test -code-completion-at=%s:54:15 %s | FileCheck -check-prefix=CHECK-NO1 %s -// CHECK-NO1: ObjCPropertyDecl:{ResultType int}{TypedText foo} (35) +// CHECK-NO1: ObjCPropertyDecl:{ResultType int}{TypedText foo} (37) // CHECK-NO1-NEXT: ObjCPropertyDecl:{ResultType Obj *}{TypedText obj} (35) -// CHECK-NO1-NEXT: ObjCPropertyDecl:{ResultType void (^)(Obj *)}{TypedText onAction} (35) +// CHECK-NO1-NEXT: ObjCPropertyDecl:{ResultType void (^)(Obj *)}{TypedText onAction} (37) // CHECK-NO1-NEXT: ObjCPropertyDecl:{ResultType FooBlock}{TypedText onEventHandler} (35) // CHECK-NO1-NEXT: ObjCPropertyDecl:{ResultType void (^)(int *)}{TypedText onReadonly} (35) // CHECK-NO1-NEXT: ObjCPropertyDecl:{ResultType int (^)(int)}{TypedText processEvent} (35) diff --git a/clang/test/Index/complete-member-access.m b/clang/test/Index/complete-member-access.m index 5e40be1eac0..0248cd1fabc 100644 --- a/clang/test/Index/complete-member-access.m +++ b/clang/test/Index/complete-member-access.m @@ -61,8 +61,8 @@ int test_two_levels(Other *other) { // RUN: c-index-test -code-completion-at=%s:34:12 %s | FileCheck -check-prefix=CHECK-CC3 %s // CHECK-CC3: ObjCInstanceMethodDecl:{ResultType int}{TypedText myOtherPropLikeThing} (37) // CHECK-CC3: ObjCPropertyDecl:{ResultType int}{TypedText myProp} (35) -// CHECK-CC3: ObjCPropertyDecl:{ResultType int}{TypedText prop1} (35) -// CHECK-CC3: ObjCPropertyDecl:{ResultType float}{TypedText ProtoProp} (35) +// CHECK-CC3: ObjCPropertyDecl:{ResultType int}{TypedText prop1} (37) +// CHECK-CC3: ObjCPropertyDecl:{ResultType float}{TypedText ProtoProp} (37) // CHECK-CC3: Completion contexts: // CHECK-CC3-NEXT: Objective-C property access // CHECK-CC3-NEXT: Container Kind: ObjCInterfaceDecl @@ -72,6 +72,6 @@ int test_two_levels(Other *other) { // RUN: c-index-test -code-completion-at=%s:42:20 %s | FileCheck -check-prefix=CHECK-CC4 %s // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText myOtherPropLikeThing} (37) // CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText myProp} (35) -// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText prop1} (35) -// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText ProtoProp} (35) +// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText prop1} (37) +// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText ProtoProp} (37) diff --git a/clang/test/Index/complete-properties.m b/clang/test/Index/complete-properties.m index 0c49819ac2a..7dd4f1c9afb 100644 --- a/clang/test/Index/complete-properties.m +++ b/clang/test/Index/complete-properties.m @@ -77,11 +77,11 @@ id test(I3 *i3) { // CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} // RUN: c-index-test -code-completion-at=%s:29:13 %s | FileCheck -check-prefix=CHECK-CC5 %s -// CHECK-CC5: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} (35) -// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} (35) -// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText Prop2} (35) +// CHECK-CC5: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} (37) +// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} (37) +// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText Prop2} (37) // CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} (35) -// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} (35) +// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} (37) // RUN: c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC6 %s // CHECK-CC6: ObjCInterfaceDecl:{TypedText MyClass} (50) @@ -93,7 +93,7 @@ id test(I3 *i3) { // CHECK-CC7: ObjCIvarDecl:{ResultType id}{TypedText Prop2_} (7) // RUN: c-index-test -code-completion-at=%s:57:13 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC8 %s -// CHECK-CC8: ObjCPropertyDecl:{ResultType int}{TypedText Prop5} (35) +// CHECK-CC8: ObjCPropertyDecl:{ResultType int}{TypedText Prop5} (37) @interface ClassProperties @@ -157,12 +157,12 @@ void classProperties() { // CHECK-CC9-NOT: instanceProperty // RUN: c-index-test -code-completion-at=%s:145:28 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC10 %s -// CHECK-CC10: ObjCPropertyDecl:{ResultType int}{TypedText explicit} (35) -// CHECK-CC10-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText explicitInProtocol} (35) -// CHECK-CC10-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText explicitReadonly} (35) -// CHECK-CC10-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicit} (37) -// CHECK-CC10-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicitInCategory} (37) -// CHECK-CC10-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicitReadonly} (37) +// CHECK-CC10: ObjCPropertyDecl:{ResultType int}{TypedText explicit} (37) +// CHECK-CC10-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText explicitInProtocol} (37) +// CHECK-CC10-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText explicitReadonly} (37) +// CHECK-CC10-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicit} (39) +// CHECK-CC10-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicitInCategory} (39) +// CHECK-CC10-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicitReadonly} (39) // CHECK-CC10-NEXT: ObjCPropertyDecl:{ResultType ClassProperties *}{TypedText shadowedImplicit} (35) // CHECK-CC10-NOT: implicitInstance // CHECK-CC10-NOT: noProperty |

