https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/77456
>From 6c184f9714c94af94c7692e1264061b8dc14e912 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH 1/3] [clang-format] Do not update cursor pos if no includes
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/77456
>From 6c184f9714c94af94c7692e1264061b8dc14e912 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH 1/2] [clang-format] Do not update cursor pos if no includes
owenca wrote:
> I have squashed the commits in only one. Note that I have left the failing
> tests in the commit, I am not sure if I should remove them or not.
Unfortunately, this wiped out my updates that fixed a formatting error and
added `#if 0` for the failing tests.
NorthBlue333 wrote:
Sure, that was was not very clear from my side I agree.
Yes, your implementation is cleaner (I don't know why I did not do that from
the beginning, I think I was struggling to fix the other tests and ended up
with something more complicated than necessary).
I have
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 6c184f9714c94af94c7692e1264061b8dc14e912 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> I've done all your changes in a second commit just to be able to keep track
> of my previous changes; but I am actually not sure how your suggested
> modifications are any different from mine? Well, I admit it looks a bit
> better, but it works the same? Or am I missing
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/77456
>From d4fd95374a82361e3dbfcd7a5d87c37da4542d2b Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH 1/4] [clang-format] Do not update cursor pos if no includes
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/77456
>From d4fd95374a82361e3dbfcd7a5d87c37da4542d2b Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH 1/3] [clang-format] Do not update cursor pos if no includes
NorthBlue333 wrote:
Friendly ping again here, as the status on this has been asked again by my
team! :)
@owenca, @mydeveloperday, and maybe @HazardyKnusperkeks (about splitting the
issue in 2).
https://github.com/llvm/llvm-project/pull/77456
___
NorthBlue333 wrote:
Woops, sorry, I missed the update here.
I've done all your changes in a second commit just to be able to keep track of
my previous changes; but I am actually not sure how your suggested
modifications are any different from mine? Well, I admit it looks a bit better,
but it
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From d4fd95374a82361e3dbfcd7a5d87c37da4542d2b Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH 1/2] [clang-format] Do not update cursor pos if no includes
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From d4fd95374a82361e3dbfcd7a5d87c37da4542d2b Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH 1/2] [clang-format] Do not update cursor pos if no includes
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From a3ddae11b909a319d73fccff409fa5c0648a234f Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH 1/2] [clang-format] Do not update cursor pos if no includes
owenca wrote:
> As a side note, I tried adding these two tests but they fail, meaning the
> cursor is still incorrectly computed with CRLF when replacing lines.
>
> This is due to adding lines between the include groups (with Regroup option),
> as this new line is added with only the
@@ -3134,20 +3135,24 @@ static void sortCppIncludes(const FormatStyle ,
}
result += Includes[Index].Text;
if (Cursor && CursorIndex == Index)
- *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset;
+ NewCursor = IncludesBeginOffset +
https://github.com/owenca commented:
`git diff Format.cpp` output:
```
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -3116,6 +3116,7 @@ static void sortCppIncludes(const FormatStyle ,
return;
}
+ const auto OldCursor = Cursor ? *Cursor : 0;
std::string
@@ -3134,20 +3135,24 @@ static void sortCppIncludes(const FormatStyle ,
}
result += Includes[Index].Text;
if (Cursor && CursorIndex == Index)
- *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset;
+ NewCursor = IncludesBeginOffset +
@@ -3134,20 +3135,24 @@ static void sortCppIncludes(const FormatStyle ,
}
result += Includes[Index].Text;
if (Cursor && CursorIndex == Index)
- *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset;
+ NewCursor = IncludesBeginOffset +
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3123,6 +3123,7 @@ static void sortCppIncludes(const FormatStyle ,
}
std::string result;
+ unsigned NewCursor = UINT_MAX;
owenca wrote:
```suggestion
const auto OldCursor = Cursor ? *Cursor : 0;
```
https://github.com/llvm/llvm-project/pull/77456
NorthBlue333 wrote:
Hi there,
Any update on this?
Friendly ping @owenca or @mydeveloperday.
I think we could maybe divide the issue in two @HazardyKnusperkeks?
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From a3ddae11b909a319d73fccff409fa5c0648a234f Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
NorthBlue333 wrote:
`clang-check` builds in local.
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
> Oh, sorry @HazardyKnusperkeks I missed this in your previous comment.
>
> I've updated the PR.
>
> As a side note, I tried adding these two tests but they fail, meaning the
> cursor is still incorrectly computed with CRLF when replacing lines.
>
> This is due to
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From ac5dccff5c1922912e88f687d2685d547f4bded9 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From c3fa004487895acb96c7eeafbd27696c35f5148e Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 86d92ae648c3d0cee305bdf0bcaadbb19a7f5f1c Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
NorthBlue333 wrote:
Oh, sorry @HazardyKnusperkeks I missed this in your previous comment.
I've updated the PR.
As a side note, I tried adding these two tests but they fail, meaning the
cursor is still incorrectly computed with CRLF when replacing lines.
This is due to adding lines between
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 4dab4e9e082551a435b79f5d4647741f4b98168c Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
@@ -3132,20 +3133,24 @@ static void sortCppIncludes(const FormatStyle ,
}
result += Includes[Index].Text;
if (Cursor && CursorIndex == Index)
- *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset;
+ NewCursor = IncludesBeginOffset +
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 1c794e5544d5f4d1a73a4410a00412f445e5c1f9 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 42b160356fe5d3b41bf07c428d0142d3721b1d44
490343ec3461a8a3a5703198f6b9af57a853ef24 --
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 7ee61d585faf393921f8964451ddc97e4cfb7444 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 490343ec3461a8a3a5703198f6b9af57a853ef24 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
NorthBlue333 wrote:
Currently fixing the tests.
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> The change is done Is the code formatting check broken?
See
[here](https://github.com/llvm/llvm-project/pull/76059#issuecomment-1865850011).
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 18163c8cad017274adaf8c4e23c0121dc1f3c844 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
NorthBlue333 wrote:
The change is done
Is the code formatting check broken?
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 04258b4ee42e29ec160b7fa4992dd1ad63db77dc Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 8081b93a021b24c5310bc9a08d00f0d07f1bbfa1 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
@@ -3131,20 +3132,25 @@ static void sortCppIncludes(const FormatStyle ,
}
result += Includes[Index].Text;
if (Cursor && CursorIndex == Index)
- *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset;
+ NewCursor = IncludesBeginOffset +
https://github.com/NorthBlue333 edited
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 263996dbd680d529f54ec576c29f210cd6904926 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
https://github.com/NorthBlue333 edited
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NorthBlue333 updated
https://github.com/llvm/llvm-project/pull/77456
>From 897c90c09f24b6fd8b0c84b57a284cabb77c9e80 Mon Sep 17 00:00:00 2001
From: NorthBlue333
Date: Tue, 9 Jan 2024 14:01:14 +0100
Subject: [PATCH] [clang-format] Do not update cursor pos if no includes
https://github.com/NorthBlue333 edited
https://github.com/llvm/llvm-project/pull/77456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
50 matches
Mail list logo