[PATCH] D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren
Owen Pan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 23 15:46:24 PDT 2019
owenpan added inline comments.
================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2618
+ // using (FileStream fs...
+ if (Style.isCSharp() && Left.is(tok::kw_using) && Right.is(tok::l_paren))
+ return true;
----------------
`if (Style.isCSharp() && Left.is(tok::kw_using))` would suffice as `Right.is(tok::l_paren)` is already checked on Line 2613.
================
Comment at: clang/unittests/Format/FormatTestCSharp.cpp:169
+TEST_F(FormatTestCSharp, CSharpUsing) {
+ verifyFormat("using (StreamWriter sw = new StreamWriter(filename) { }");
+}
----------------
Maybe set `SpaceBeforeParens` to `Always` first in order to really test the new behavior?
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66662/new/
https://reviews.llvm.org/D66662
More information about the llvm-commits
mailing list