[cfe-commits] r116097 - in /cfe/trunk: lib/Sema/SemaCodeComplete.cpp test/CodeCompletion/ordinary-name.cpp tools/c-index-test/c-index-test.c tools/libclang/CIndexCodeCompletion.cpp
Douglas Gregor
dgregor at apple.com
Fri Oct 8 13:39:30 PDT 2010
Author: dgregor
Date: Fri Oct 8 15:39:29 2010
New Revision: 116097
URL: http://llvm.org/viewvc/llvm-project?rev=116097&view=rev
Log:
Fix the mapping of vertical-space cursor kinds to produce a newline,
rather than a space.
Modified:
cfe/trunk/lib/Sema/SemaCodeComplete.cpp
cfe/trunk/test/CodeCompletion/ordinary-name.cpp
cfe/trunk/tools/c-index-test/c-index-test.c
cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=116097&r1=116096&r2=116097&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Fri Oct 8 15:39:29 2010
@@ -1559,6 +1559,7 @@
Pattern->AddPlaceholderChunk("inc-expression");
Pattern->AddChunk(CodeCompletionString::CK_RightParen);
Pattern->AddChunk(CodeCompletionString::CK_LeftBrace);
+ Pattern->AddChunk(CodeCompletionString::CK_VerticalSpace);
Pattern->AddPlaceholderChunk("statements");
Pattern->AddChunk(CodeCompletionString::CK_VerticalSpace);
Pattern->AddChunk(CodeCompletionString::CK_RightBrace);
Modified: cfe/trunk/test/CodeCompletion/ordinary-name.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeCompletion/ordinary-name.cpp?rev=116097&r1=116096&r2=116097&view=diff
==============================================================================
--- cfe/trunk/test/CodeCompletion/ordinary-name.cpp (original)
+++ cfe/trunk/test/CodeCompletion/ordinary-name.cpp Fri Oct 8 15:39:29 2010
@@ -20,7 +20,7 @@
// CHECK-CC1-NEXT: COMPLETION: false
// CHECK-CC1-NEXT: COMPLETION: float
// CHECK-CC1-NEXT: COMPLETION: foo : [#void#]foo()
- // CHECK-CC1-NEXT: COMPLETION: Pattern : for(<#init-statement#>;<#condition#>;<#inc-expression#>){<#statements#>
+ // CHECK-CC1-NEXT: COMPLETION: Pattern : for(<#init-statement#>;<#condition#>;<#inc-expression#>){
// CHECK-CC1: COMPLETION: Pattern : goto <#label#>
// CHECK-CC1-NEXT: COMPLETION: Pattern : if(<#condition#>){<#statements#>
// CHECK-CC1: COMPLETION: int
Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=116097&r1=116096&r2=116097&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Fri Oct 8 15:39:29 2010
@@ -939,6 +939,11 @@
file);
fprintf(file, "}");
continue;
+ }
+
+ if (Kind == CXCompletionChunk_VerticalSpace) {
+ fprintf(file, "{VerticalSpace }");
+ continue;
}
text = clang_getCompletionChunkText(completion_string, I);
Modified: cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp?rev=116097&r1=116096&r2=116097&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp Fri Oct 8 15:39:29 2010
@@ -146,11 +146,8 @@
case CodeCompletionString::CK_SemiColon:
case CodeCompletionString::CK_Equal:
case CodeCompletionString::CK_HorizontalSpace:
- return createCXString((*CCStr)[chunk_number].Text, false);
-
case CodeCompletionString::CK_VerticalSpace:
- // FIXME: Temporary hack until we figure out how to handle vertical space.
- return createCXString(" ");
+ return createCXString((*CCStr)[chunk_number].Text, false);
case CodeCompletionString::CK_Optional:
// Note: treated as an empty text block.
More information about the cfe-commits
mailing list