forked from qt-creator/qt-creator
ClangFormat: Sprinkle some more magic pixie dust
Apparently, we can prevent clang-format from removing line breaks by adding an empty comment at the end of the line. Change-Id: Ia78ecb9e7351d059c544cbda11d33af5734e2218 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -198,14 +198,7 @@ TEST_F(ClangFormat, IndentLambdaWithReturnType)
|
||||
"}"));
|
||||
}
|
||||
|
||||
#ifndef KEEP_LINE_BREAKS_FOR_NON_EMPTY_LINES_BACKPORTED
|
||||
# define DISABLED_FOR_VANILLA_CLANG(x) DISABLED_##x
|
||||
#else
|
||||
# define DISABLED_FOR_VANILLA_CLANG(x) x
|
||||
#endif
|
||||
|
||||
// This test requires the custom clang patch https://code.qt.io/cgit/clang/llvm-project.git/commit/?h=release_100-based&id=9b992a0f7f160dd6c75f20a4dcfcf7c60a4894df
|
||||
TEST_F(ClangFormat, DISABLED_FOR_VANILLA_CLANG(IndentFunctionArgumentLambdaWithNextLineScope))
|
||||
TEST_F(ClangFormat, ClangFormatIndentFunctionArgumentLambdaWithNextLineScope)
|
||||
{
|
||||
insertLines({"foo([]()",
|
||||
"{",
|
||||
@@ -954,6 +947,16 @@ TEST_F(ClangFormat, SortIncludes)
|
||||
"#include <aa.h>",
|
||||
"#include <bb.h>"));
|
||||
}
|
||||
|
||||
TEST_F(ClangFormat, ChainedMemberFunctionCalls)
|
||||
{
|
||||
insertLines({"S().func().func()",
|
||||
".func();"});
|
||||
indenter.indent(cursor, QChar::Null, TextEditor::TabSettings());
|
||||
ASSERT_THAT(documentLines(), ElementsAre("S().func().func()",
|
||||
" .func();"));
|
||||
}
|
||||
|
||||
// clang-format on
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user