From: Argyrios Kyrtzidis Date: Thu, 20 Feb 2014 07:55:15 +0000 (+0000) Subject: [code-completion] Style guideline for Cocoa has custom accessor in property declarati... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=24ea2325c196e475897872014e3bfde2f031ee35;p=clang [code-completion] Style guideline for Cocoa has custom accessor in property declarations without spaces around '='. rdar://16059171 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201765 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 78dd5cd305..00232f64b7 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -4752,7 +4752,7 @@ void Sema::CodeCompleteObjCPropertyFlags(Scope *S, ObjCDeclSpec &ODS) { CodeCompletionBuilder Setter(Results.getAllocator(), Results.getCodeCompletionTUInfo()); Setter.AddTypedTextChunk("setter"); - Setter.AddTextChunk(" = "); + Setter.AddTextChunk("="); Setter.AddPlaceholderChunk("method"); Results.AddResult(CodeCompletionResult(Setter.TakeString())); } @@ -4760,7 +4760,7 @@ void Sema::CodeCompleteObjCPropertyFlags(Scope *S, ObjCDeclSpec &ODS) { CodeCompletionBuilder Getter(Results.getAllocator(), Results.getCodeCompletionTUInfo()); Getter.AddTypedTextChunk("getter"); - Getter.AddTextChunk(" = "); + Getter.AddTextChunk("="); Getter.AddPlaceholderChunk("method"); Results.AddResult(CodeCompletionResult(Getter.TakeString())); } diff --git a/test/Index/complete-property-flags.m b/test/Index/complete-property-flags.m index 86ee8e26f7..13ec1e725f 100644 --- a/test/Index/complete-property-flags.m +++ b/test/Index/complete-property-flags.m @@ -11,12 +11,12 @@ // CHECK-CC1: {TypedText assign} // CHECK-CC1-NEXT: {TypedText atomic} // CHECK-CC1-NEXT: {TypedText copy} -// CHECK-CC1-NEXT: {TypedText getter}{Text = }{Placeholder method} +// CHECK-CC1-NEXT: {TypedText getter}{Text =}{Placeholder method} // CHECK-CC1-NEXT: {TypedText nonatomic} // CHECK-CC1-NEXT: {TypedText readonly} // CHECK-CC1-NEXT: {TypedText readwrite} // CHECK-CC1-NEXT: {TypedText retain} -// CHECK-CC1-NEXT: {TypedText setter}{Text = }{Placeholder method} +// CHECK-CC1-NEXT: {TypedText setter}{Text =}{Placeholder method} // CHECK-CC1-NEXT: {TypedText strong} // CHECK-CC1-NEXT: {TypedText unsafe_unretained} // CHECK-CC1-NOT: {TypedText weak} @@ -25,20 +25,20 @@ // CHECK-CC1-ARC: {TypedText assign} // CHECK-CC1-ARC-NEXT: {TypedText atomic} // CHECK-CC1-ARC-NEXT: {TypedText copy} -// CHECK-CC1-ARC-NEXT: {TypedText getter}{Text = }{Placeholder method} +// CHECK-CC1-ARC-NEXT: {TypedText getter}{Text =}{Placeholder method} // CHECK-CC1-ARC-NEXT: {TypedText nonatomic} // CHECK-CC1-ARC-NEXT: {TypedText readonly} // CHECK-CC1-ARC-NEXT: {TypedText readwrite} // CHECK-CC1-ARC-NEXT: {TypedText retain} -// CHECK-CC1-ARC-NEXT: {TypedText setter}{Text = }{Placeholder method} +// CHECK-CC1-ARC-NEXT: {TypedText setter}{Text =}{Placeholder method} // CHECK-CC1-ARC-NEXT: {TypedText strong} // CHECK-CC1-ARC-NEXT: {TypedText unsafe_unretained} // CHECK-CC1-ARC-NEXT: {TypedText weak} // RUN: c-index-test -code-completion-at=%s:8:18 %s | FileCheck -check-prefix=CHECK-CC2 %s -// CHECK-CC2: {TypedText getter}{Text = }{Placeholder method} +// CHECK-CC2: {TypedText getter}{Text =}{Placeholder method} // CHECK-CC2-NEXT: {TypedText nonatomic} // CHECK-CC2-NEXT: {TypedText readonly} // CHECK-CC2-NEXT: {TypedText readwrite} -// CHECK-CC2-NEXT: {TypedText setter}{Text = }{Placeholder method} +// CHECK-CC2-NEXT: {TypedText setter}{Text =}{Placeholder method} @end