[cfe-commits] r162084 - in /cfe/trunk: lib/Sema/SemaCodeComplete.cpp test/CodeCompletion/objc-expr.m test/Index/complete-exprs.m

Douglas Gregor dgregor at apple.com
Thu Aug 16 22:40:05 PDT 2012


Author: dgregor
Date: Fri Aug 17 00:40:05 2012
New Revision: 162084

URL: http://llvm.org/viewvc/llvm-project?rev=162084&view=rev
Log:
Make the spacing of the code completion result for NSDictionary
literals match the spacing introduced by the ObjC modernizer. Fixes
the rest of <rdar://problem/11889572>.

Modified:
    cfe/trunk/lib/Sema/SemaCodeComplete.cpp
    cfe/trunk/test/CodeCompletion/objc-expr.m
    cfe/trunk/test/Index/complete-exprs.m

Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=162084&r1=162083&r2=162084&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Fri Aug 17 00:40:05 2012
@@ -4476,7 +4476,6 @@
   Builder.AddResultTypeChunk("NSDictionary *");
   Builder.AddTypedTextChunk(OBJC_AT_KEYWORD_NAME(NeedAt,"{"));
   Builder.AddPlaceholderChunk("key");
-  Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
   Builder.AddChunk(CodeCompletionString::CK_Colon);
   Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
   Builder.AddPlaceholderChunk("object, ...");

Modified: cfe/trunk/test/CodeCompletion/objc-expr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeCompletion/objc-expr.m?rev=162084&r1=162083&r2=162084&view=diff
==============================================================================
--- cfe/trunk/test/CodeCompletion/objc-expr.m (original)
+++ cfe/trunk/test/CodeCompletion/objc-expr.m Fri Aug 17 00:40:05 2012
@@ -11,7 +11,7 @@
 // CHECK-AT: COMPLETION: Pattern : [#char[]#]encode(<#type-name#>)
 // CHECK-AT: COMPLETION: Pattern : [#Protocol *#]protocol(<#protocol-name#>)
 // CHECK-AT: COMPLETION: Pattern : [#SEL#]selector(<#selector#>)
-// CHECK-AT: COMPLETION: Pattern : [#NSDictionary *#]{<#key#> : <#object, ...#>}
+// CHECK-AT: COMPLETION: Pattern : [#NSDictionary *#]{<#key#>: <#object, ...#>}
 
 // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:4:11 %s -fconst-strings -o - | FileCheck -check-prefix=CONST-STRINGS %s
 // CHECK-CONST-STRINGS: COMPLETION: Pattern : [#const char[]#]encode(<#type-name#>)

Modified: cfe/trunk/test/Index/complete-exprs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/complete-exprs.m?rev=162084&r1=162083&r2=162084&view=diff
==============================================================================
--- cfe/trunk/test/Index/complete-exprs.m (original)
+++ cfe/trunk/test/Index/complete-exprs.m Fri Aug 17 00:40:05 2012
@@ -21,7 +21,7 @@
 // CHECK-CC1: NotImplemented:{ResultType NSString *}{TypedText @"}{Placeholder string}{Text "} (40)
 // CHECK-CC1: NotImplemented:{ResultType id}{TypedText @(}{Placeholder expression}{RightParen )} (40)
 // CHECK-CC1: NotImplemented:{ResultType NSArray *}{TypedText @[}{Placeholder objects, ...}{RightBracket ]} (40)
-// CHECK-CC1: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{HorizontalSpace  }{Colon :}{HorizontalSpace  }{Placeholder object, ...}{RightBrace }} (40)
+// CHECK-CC1: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{Colon :}{HorizontalSpace  }{Placeholder object, ...}{RightBrace }} (40)
 // CHECK-CC1: NotImplemented:{ResultType SEL}{TypedText _cmd} (80)
 // CHECK-CC1: TypedefDecl:{TypedText BOOL} (50)
 // CHECK-CC1: macro definition:{TypedText bool} (51)
@@ -43,7 +43,7 @@
 // RUN: c-index-test -code-completion-at=%s:16:5 %s | FileCheck -check-prefix=CHECK-CC4 %s
 // RUN: c-index-test -code-completion-at=%s:16:14 %s | FileCheck -check-prefix=CHECK-CC4 %s
 // CHECK-CC4: NotImplemented:{ResultType NSArray *}{TypedText @[}{Placeholder objects, ...}{RightBracket ]} (40)
-// CHECK-CC4: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{HorizontalSpace  }{Colon :}{HorizontalSpace  }{Placeholder object, ...}{RightBrace }} (40)
+// CHECK-CC4: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{Colon :}{HorizontalSpace  }{Placeholder object, ...}{RightBrace }} (40)
 // CHECK-CC4: NotImplemented:{ResultType SEL}{TypedText _cmd} (80)
 // CHECK-CC4: macro definition:{TypedText bool} (51)
 // CHECK-CC4: macro definition:{TypedText NO} (65)





More information about the cfe-commits mailing list