[clang-tools-extra] r362363 - [CodeComplete] Add a bit more whitespace to completed patterns

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 3 01:34:26 PDT 2019


Author: ibiryukov
Date: Mon Jun  3 01:34:25 2019
New Revision: 362363

URL: http://llvm.org/viewvc/llvm-project?rev=362363&view=rev
Log:
[CodeComplete] Add a bit more whitespace to completed patterns

Summary:
E.g. we now turn `while(<#cond#>){` into `while (<#cond#>) {`

This slightly improves the final output. Should not affect clients that
format the result on their own.

Reviewers: gribozavr

Reviewed By: gribozavr

Subscribers: jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62616

Modified:
    clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp

Modified: clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp?rev=362363&r1=362362&r2=362363&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/CodeCompleteTests.cpp Mon Jun  3 01:34:25 2019
@@ -2436,7 +2436,7 @@ TEST(CompletionTest, CursorInSnippets) {
   EXPECT_THAT(
       Results.Completions,
       Contains(AllOf(Named("while"),
-                     SnippetSuffix("(${1:condition}){\n${0:statements}\n}"))));
+                     SnippetSuffix(" (${1:condition}) {\n${0:statements}\n}"))));
   // However, snippets for functions must *not* end with $0.
   EXPECT_THAT(Results.Completions,
               Contains(AllOf(Named("while_foo"),




More information about the cfe-commits mailing list