https://github.com/jp4a50 created
https://github.com/llvm/llvm-project/pull/66755
By default, OuterScope aligns lambdas to the beginning of the current line.
This makes sense for most types of statements within code blocks but leads to
unappealing and misleading indentation for lambdas within
jp4a50 wrote:
> I'm not sure I understand, looking at
> https://clang.llvm.org/docs/ClangFormatStyleOptions.html#lambdabodyindentation
> it seems to explicitly state it should be at the outer function scope, can
> you point to a github issue this is trying to solve or is this just personal
>
@@ -22537,10 +22537,12 @@ TEST_F(FormatTest, FormatsLambdas) {
" }\n"
"}",
Style);
- verifyFormat("std::sort(v.begin(), v.end(),\n"
- " [](const auto &foo, const auto &bar) {\n"
- " return foo.
@@ -22537,10 +22537,12 @@ TEST_F(FormatTest, FormatsLambdas) {
" }\n"
"}",
Style);
- verifyFormat("std::sort(v.begin(), v.end(),\n"
- " [](const auto &foo, const auto &bar) {\n"
- " return foo.
https://github.com/jp4a50 updated
https://github.com/llvm/llvm-project/pull/66755
>From e07d263a37ef37a21bb5cf424b14be83088eed3d Mon Sep 17 00:00:00 2001
From: Jon Phillips
Date: Tue, 19 Sep 2023 10:29:57 +0100
Subject: [PATCH 1/2] [clang-format] Disable OuterScope lambda indentation
behaviour
@@ -22537,10 +22537,12 @@ TEST_F(FormatTest, FormatsLambdas) {
" }\n"
"}",
Style);
- verifyFormat("std::sort(v.begin(), v.end(),\n"
- " [](const auto &foo, const auto &bar) {\n"
- " return foo.
https://github.com/jp4a50 updated
https://github.com/llvm/llvm-project/pull/66755
>From e07d263a37ef37a21bb5cf424b14be83088eed3d Mon Sep 17 00:00:00 2001
From: Jon Phillips
Date: Tue, 19 Sep 2023 10:29:57 +0100
Subject: [PATCH 1/3] [clang-format] Disable OuterScope lambda indentation
behaviour
jp4a50 wrote:
> You should adapt the documentation.
Done. Tried to capture the original intention of the option which is to
minimize (and make consistent) indentation of lambdas at block scope. This PR
addresses the most obvious exception to block scope but there may be more that
we can addre
jp4a50 wrote:
Thanks for the reviews! Can someone please merge for me? @HazardyKnusperkeks
@owenca
https://github.com/llvm/llvm-project/pull/66755
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo