[PATCH] D62615: [CodeComplete] Include more text into typed chunks of pattern completions
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 4 02:23:22 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL362479: [CodeComplete] Include more text into typed chunks of pattern completions (authored by ibiryukov, committed by ).
Herald added subscribers: llvm-commits, arphaman.
Herald added a project: LLVM.
Changed prior to commit:
https://reviews.llvm.org/D62615?vs=202001&id=202880#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62615/new/
https://reviews.llvm.org/D62615
Files:
cfe/trunk/lib/Sema/SemaCodeComplete.cpp
cfe/trunk/test/CodeCompletion/ordinary-name-cxx11.cpp
cfe/trunk/test/CodeCompletion/ordinary-name.cpp
cfe/trunk/test/Index/complete-stmt.c
Index: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp
@@ -1919,9 +1919,7 @@
Results.AddResult(Result(Builder.TakeString()));
// Using directives
- Builder.AddTypedTextChunk("using");
- Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
- Builder.AddTextChunk("namespace");
+ Builder.AddTypedTextChunk("using namespace");
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
Builder.AddPlaceholderChunk("identifier");
Builder.AddChunk(CodeCompletionString::CK_SemiColon);
@@ -1964,9 +1962,7 @@
// using typename qualifier::name (only in a dependent context)
if (SemaRef.CurContext->isDependentContext()) {
- Builder.AddTypedTextChunk("using");
- Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
- Builder.AddTextChunk("typename");
+ Builder.AddTypedTextChunk("using typename");
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
Builder.AddPlaceholderChunk("qualifier");
Builder.AddTextChunk("::");
@@ -2236,9 +2232,7 @@
Results.AddResult(Result(Builder.TakeString()));
// Using directives
- Builder.AddTypedTextChunk("using");
- Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
- Builder.AddTextChunk("namespace");
+ Builder.AddTypedTextChunk("using namespace");
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
Builder.AddPlaceholderChunk("identifier");
Builder.AddChunk(CodeCompletionString::CK_SemiColon);
@@ -5201,9 +5195,7 @@
Results.AddResult(Builder.TakeString());
// "else if" block
- Builder.AddTypedTextChunk("else");
- Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
- Builder.AddTextChunk("if");
+ Builder.AddTypedTextChunk("else if");
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
if (getLangOpts().CPlusPlus)
Index: cfe/trunk/test/Index/complete-stmt.c
===================================================================
--- cfe/trunk/test/Index/complete-stmt.c
+++ cfe/trunk/test/Index/complete-stmt.c
@@ -9,11 +9,11 @@
// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:7:4 %s | FileCheck -check-prefix=CHECK-IF-ELSE %s
// CHECK-IF-ELSE: NotImplemented:{TypedText else}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Placeholder statements}{VerticalSpace }{RightBrace }} (40)
-// CHECK-IF-ELSE: NotImplemented:{TypedText else}{HorizontalSpace }{Text if}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Placeholder statements}{VerticalSpace }{RightBrace }} (40)
+// CHECK-IF-ELSE: NotImplemented:{TypedText else if}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Placeholder statements}{VerticalSpace }{RightBrace }} (40)
// RUN: c-index-test -code-completion-at=%s:7:4 %s | FileCheck -check-prefix=CHECK-IF-ELSE-SIMPLE %s
// CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else} (40)
-// CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else}{HorizontalSpace }{Text if}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )} (40)
+// CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else if}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )} (40)
// RUN: c-index-test -code-completion-at=%s:6:1 %s | FileCheck -check-prefix=CHECK-STMT %s
// CHECK-STMT: NotImplemented:{TypedText _Nonnull} (50)
Index: cfe/trunk/test/CodeCompletion/ordinary-name.cpp
===================================================================
--- cfe/trunk/test/CodeCompletion/ordinary-name.cpp
+++ cfe/trunk/test/CodeCompletion/ordinary-name.cpp
@@ -102,8 +102,8 @@
// CHECK-CC2-NEXT: COMPLETION: Pattern : typeof(<#type#>)
// CHECK-CC2-NEXT: COMPLETION: union
// CHECK-CC2-NEXT: COMPLETION: unsigned
- // CHECK-CC2-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
// CHECK-CC2-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#>;
+ // CHECK-CC2-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
// CHECK-CC2-NEXT: COMPLETION: void
// CHECK-CC2-NEXT: COMPLETION: volatile
// CHECK-CC2-NEXT: COMPLETION: wchar_t
Index: cfe/trunk/test/CodeCompletion/ordinary-name-cxx11.cpp
===================================================================
--- cfe/trunk/test/CodeCompletion/ordinary-name-cxx11.cpp
+++ cfe/trunk/test/CodeCompletion/ordinary-name-cxx11.cpp
@@ -112,8 +112,8 @@
// CHECK-CC2-NEXT: COMPLETION: Pattern : typeof(<#type#>)
// CHECK-CC2-NEXT: COMPLETION: union
// CHECK-CC2-NEXT: COMPLETION: unsigned
- // CHECK-CC2-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
// CHECK-CC2-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#>;
+ // CHECK-CC2-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
// CHECK-CC2-NEXT: COMPLETION: void
// CHECK-CC2-NEXT: COMPLETION: volatile
// CHECK-CC2-NEXT: COMPLETION: wchar_t
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62615.202880.patch
Type: text/x-patch
Size: 5215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190604/0b672887/attachment.bin>
More information about the llvm-commits
mailing list