Hey Hans,
There is actually a parent for this patch at
https://reviews.llvm.org/rC351531 and it hasn't been merged.
In addition to that not exactly as a follow-up, but there is
https://reviews.llvm.org/rCTE351738 which is kind of related to this two
patches, you might also consider merging that b
Thanks Bruno, sent out rL358293 to address the issue.
On Fri, Apr 12, 2019 at 5:21 PM Bruno Ricci wrote:
> Hi,
>
> It seems that one of r358272, r358273 or r358274 is causing some asan
> failure on my machine. Not sure why it is not spotted by the bots.
>
> Failure log attached.
>
> Bruno
>
Thanks for the fix Nico!
On Sun, Apr 21, 2019 at 9:17 PM Nico Weber wrote:
> r358858 might help with this.
>
> On Sat, Apr 20, 2019 at 7:15 PM Nico Weber wrote:
>
>> This breaks building with LLVM_ENABLE_THREADS=OFF. The call probably
>> needs to be behind a `#if LLVM_ENABLE_THREADS`.
>>
>> FAI
Hi Azhar, D64980 should fix the problem. I am reverting your revert while
adding the fix in r366559.
On Fri, Jul 19, 2019 at 11:29 AM Azhar Mohammed wrote:
> Reverted in r366551.
>
>
> Revert r366458, r366467 and r366468
>
> r366458 is causing test failures. r366467 and r366468 had to be
https://reviews.llvm.org/rL365140 should fix it, please let me know if it
doesnt.
On Thu, Jul 4, 2019 at 3:45 PM wrote:
> Hi Kadir,
>
> Your change is causing a build failure on our internal linux build bot
> running gcc 5.4:
>
> FAILED: CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache
> /usr/
thanks! sent out D68702.
On Wed, Oct 9, 2019 at 2:56 PM Nico Weber wrote:
> Looks like this breaks three clangd tests on macOS:
>
> Failing Tests (3):
> Clangd :: code-action-request.test
> Clangd :: execute-command.test
> Clangd :: tweaks-format.test
>
> libc++abi.dylib: terminating
Hi Jan,
I don't think there's much point in running ReplayPreamble with an empty
preamble, but this should already be a no-op as there can't be any includes
inside the preamble region if size is 0.
I can't seem to reproduce a failure with the root causes you've provided.
Even when ReplayPreamble:
managed to reproduce the issue. sent out https://reviews.llvm.org/D80988
for a fix.
On Tue, Jun 2, 2020 at 12:08 PM Sam McCall wrote:
> On Tue, Jun 2, 2020 at 10:38 AM Kadir Çetinkaya
> wrote:
>
>> Hi Jan,
>>
>> I don't think there's much point in running ReplayPreamble with an empty
>> preambl
thanks for letting me know. it is annoying that the test is flaky, but I
don't see that flakiness on any other buildbot I've access to.
Is there any chance that you are running in a custom build configuration
that I can try to repro the failure? Also what's the falkiness ratio?
On Tue, Jun 2, 202
Hi Filipe! Thanks for letting me know, I've sent
https://reviews.llvm.org/D77944 to enable this in clangd lit config.
Regarding the failure, I can't seem to repro on machines I have access to.
The premerge-tests also seems to be succeeding, please see
https://results.llvm-merge-guard.org/BETA_amd6
Hi Mikael,
sent out 4f4a8ae72e95f2c7fa5e4ca56dd6b1a83a304680, please let me know if it
helps!
On Thu, Jun 4, 2020 at 12:40 PM Mikael Holmén via Phabricator <
revi...@reviews.llvm.org> wrote:
> uabelho added inline comments.
>
>
>
> Comment at: clang-tools-extra/clangd/CodeComple
Thanks Mikael,
66b54d586fa73499714e2bfef3cedffeabb08f34 should fix this.
On Fri, Apr 17, 2020 at 2:42 PM Mikael Holmén
wrote:
> Hi Kadir,
>
> I noticed in our buildbots that run with sanitizers that we got a new
> complaint with this commit. It's still there on current top-of-tree now
> so the
Thanks Mikael, sent out an ugly fix
at 89cb5d558895706e053bc3af972aa5b15aa82863 to get sanitizer build bots
running.
Will change the testing scheme for a proper fix.
On Thu, Apr 23, 2020 at 4:53 PM Mikael Holmén
wrote:
> Hi Kadir,
>
> I start seeing some sanitizer complaints with this commit fo
Thanks for bringing this up Jeremy, for some reason(I suppose due to the
existing breakage in the bot) I haven't received any mails regarding this
breakage.
Sent out 2 patches, first one seemed to fix something, but wasn't enough.
The bots have a really slow turnaround though, so it takes a while
i was trying to provide a more generic "callback" mechanism, but you are
right, it is not needed for this test.
going to keep context prop logic though, as it might be necessary later on.
SG?
On Sun, May 3, 2020 at 9:09 PM Sam McCall via Phabricator <
revi...@reviews.llvm.org> wrote:
> sammccall
thanks Hans!
On Mon, May 4, 2020 at 12:38 PM Hans Wennborg via Phabricator <
revi...@reviews.llvm.org> wrote:
> hans added a comment.
>
> For anyone running into the same problem, this broke the build with GCC 5:
>
> /work/llvm.monorepo/clang-tools-extra/clangd/ClangdServer.cpp:374:75:
> error:
yes that's the case. See
https://github.com/clangd/vscode-clangd/pulls?q=is%3Apr
On Mon, May 11, 2020 at 9:57 AM Nathan Ridge via Phabricator <
revi...@reviews.llvm.org> wrote:
> nridge added a comment.
>
> Also, does this mean that patches to vscode-clangd should now be submitted
> as a Github P
https://github.com/kadircet created
https://github.com/llvm/llvm-project/pull/72122
None
From a73b13d6fe7691a3d12840895ad56a859d5d9f9b Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Mon, 13 Nov 2023 15:52:21 +0100
Subject: [PATCH] [clangd] Improve sys header mapping
---
clang-tools-ext
https://github.com/kadircet created
https://github.com/llvm/llvm-project/pull/72125
Fixes https://github.com/llvm/llvm-project/issues/64382.
From 8a96c67f70f9ae77d3e1576f49cd1ff7880e6e00 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Mon, 13 Nov 2023 16:20:01 +0100
Subject: [PATCH] [inc
https://github.com/kadircet closed
https://github.com/llvm/llvm-project/pull/72125
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet closed
https://github.com/llvm/llvm-project/pull/72122
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet created
https://github.com/llvm/llvm-project/pull/72246
This was creating discrepancy in cases where we might have a physical
file entry (e.g. because we followed a source location from a stdlib
file) and tried to find its exporters.
From 49ea3ae3468c5d67b2b6b03339d
@@ -232,6 +232,17 @@ class PragmaIncludes::RecordPragma : public PPCallbacks,
public CommentHandler {
void checkForExport(FileID IncludingFile, int HashLine,
std::optional IncludedHeader,
OptionalFileEntryRef IncludedFile) {
+a
@@ -232,6 +232,17 @@ class PragmaIncludes::RecordPragma : public PPCallbacks,
public CommentHandler {
void checkForExport(FileID IncludingFile, int HashLine,
std::optional IncludedHeader,
OptionalFileEntryRef IncludedFile) {
+a
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/72246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/72246
From 84f320a1c746eddea3171bd984613464a5872cbb Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Tue, 14 Nov 2023 13:08:52 +0100
Subject: [PATCH] [include-cleaner] Make sure exports of stdlib also works for
p
https://github.com/kadircet closed
https://github.com/llvm/llvm-project/pull/72246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kadircet wrote:
Thanks! I believe the idea is great, but I am not really sure if this is useful
enough without handling anon namespaces properly. It's very rare that someone
has a class/struct in a cc file, that isn't in an anon-namespace.
Would you mind evolving the patch (and the infra) to w
kadircet wrote:
Yes, the current logic that finds insertion point wont work in presence of anon
namespaces.
We normally do some pseudo parsing to find a location to insert the definiton,
but because these are happening inside the main-file now, you can directly make
use of sourcelocations ins
kadircet wrote:
hi! thanks for the interest @sr-tream but I am afraid this is likely to cause
disruption in more cases than it might improve.
apart from technical details like the threading concerns and reliance on
certain variants that we don't really have (eg order of includes); at a high
l
kadircet wrote:
> We can limit ourselves to only the paired source file, and cancel inclusions
> if the source file does not include a non-self-contained header directly.
> This will reduce the number of situations in which this hack works, but will
> avoid the problems you describe
deducing
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/69704
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet commented:
thanks, LG in general just some small adjustments
https://github.com/llvm/llvm-project/pull/69704
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -435,14 +407,17 @@ class DefineOutline : public Tweak {
if (MD->getParent()->isTemplated())
return false;
- // The refactoring is meaningless for unnamed classes and definitions
- // within unnamed namespaces.
+ // The refactoring is meaningless
@@ -435,14 +407,17 @@ class DefineOutline : public Tweak {
if (MD->getParent()->isTemplated())
return false;
- // The refactoring is meaningless for unnamed classes and definitions
- // within unnamed namespaces.
+ // The refactoring is meaningless
@@ -499,17 +473,64 @@ class DefineOutline : public Tweak {
HeaderUpdates = HeaderUpdates.merge(*DelInline);
}
-auto HeaderFE = Effect::fileEdit(SM, SM.getMainFileID(), HeaderUpdates);
-if (!HeaderFE)
- return HeaderFE.takeError();
-
-Effect->ApplyEdi
@@ -499,17 +473,64 @@ class DefineOutline : public Tweak {
HeaderUpdates = HeaderUpdates.merge(*DelInline);
}
-auto HeaderFE = Effect::fileEdit(SM, SM.getMainFileID(), HeaderUpdates);
-if (!HeaderFE)
- return HeaderFE.takeError();
-
-Effect->ApplyEdi
@@ -349,6 +349,44 @@ TEST_F(DefineOutlineTest, ApplyTest) {
}
}
+TEST_F(DefineOutlineTest, InCppFile) {
+ FileName = "Test.cpp";
+
+ struct {
+llvm::StringRef Test;
+llvm::StringRef ExpectedSource;
+ } Cases[] = {
+ // Member function with some adornments
+
@@ -19,7 +19,7 @@ TWEAK_TEST(DefineOutline);
TEST_F(DefineOutlineTest, TriggersOnFunctionDecl) {
FileName = "Test.cpp";
- // Not available unless in a header file.
+ // Not available for free function unless in a header file.
kadircet wrote:
can you add s
@@ -349,6 +349,44 @@ TEST_F(DefineOutlineTest, ApplyTest) {
}
}
+TEST_F(DefineOutlineTest, InCppFile) {
+ FileName = "Test.cpp";
+
+ struct {
+llvm::StringRef Test;
+llvm::StringRef ExpectedSource;
+ } Cases[] = {
+ // Member function with some adornments
+
@@ -349,6 +358,36 @@ TEST_F(DefineOutlineTest, ApplyTest) {
}
}
+TEST_F(DefineOutlineTest, InCppFile) {
+ FileName = "Test.cpp";
+
+ struct {
+llvm::StringRef Test;
+llvm::StringRef ExpectedSource;
+ } Cases[] = {
+ {
+ R"cpp(
+namespace
@@ -499,17 +473,64 @@ class DefineOutline : public Tweak {
HeaderUpdates = HeaderUpdates.merge(*DelInline);
}
-auto HeaderFE = Effect::fileEdit(SM, SM.getMainFileID(), HeaderUpdates);
-if (!HeaderFE)
- return HeaderFE.takeError();
-
-Effect->ApplyEdi
@@ -19,7 +19,7 @@ TWEAK_TEST(DefineOutline);
TEST_F(DefineOutlineTest, TriggersOnFunctionDecl) {
FileName = "Test.cpp";
- // Not available unless in a header file.
+ // Not available for free function unless in a header file.
kadircet wrote:
well, availab
kadircet wrote:
thanks for the revert! I also encountered certain crashes bisecting back to
this patch, with a similar reproducer:
```
template
struct Module {
template
struct Baz {
template
explicit Baz(X);
};
Baz(int) -> Baz;
};
struct Bar {};
void foo() { Module::Baz x{2}
https://github.com/kadircet created
https://github.com/llvm/llvm-project/pull/75612
This makes PragmaIncldues copyable, and copies it from preamble when building a
new AST.
Fixes https://github.com/clangd/clangd/issues/1843
Fixes https://github.com/clangd/clangd/issues/1571
From 8801af07ad4e4
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/75612
From 8801af07ad4e469f832570b5027e1522f41a6d06 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Fri, 15 Dec 2023 15:14:05 +0100
Subject: [PATCH 1/2] [clangd] Track IWYU pragmas for non-preamble includes
---
@@ -113,7 +113,7 @@ class PragmaIncludes {
llvm::DenseSet ShouldKeep;
/// Owns the strings.
- llvm::BumpPtrAllocator Arena;
+ std::shared_ptr Arena;
kadircet wrote:
you're right in theory, but in practice we actually never build ASTs
concurrently from
https://github.com/kadircet created
https://github.com/llvm/llvm-project/pull/75965
Header gurads are not detected until we hit EOF. Make sure we postpone
any such detection until then.
From 32cfb9f9c196e665009051f83489ab09c36dd87a Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Tue, 19
https://github.com/kadircet requested changes to this pull request.
thanks a lot (and sorry for missing this, so far)
https://github.com/llvm/llvm-project/pull/71605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/71605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -189,6 +189,10 @@ llvm::Expected Marshaller::fromProtobuf(const
Ref &Message) {
return Location.takeError();
Result.Location = *Location;
Result.Kind = static_cast(Message.kind());
+ auto ContainerID = SymbolID::fromStr(Message.container());
+ if (!ContainerID)
+
@@ -223,6 +223,7 @@ TEST(RemoteMarshallingTest, RefSerialization) {
Location.FileURI = testPathURI(
"llvm-project/llvm/clang-tools-extra/clangd/Protocol.h", Strings);
Ref.Location = Location;
+ Ref.Container = llvm::cantFail(SymbolID::fromStr("0001"));
--
https://github.com/kadircet approved this pull request.
thanks and sorry for leaving this out there, I was busy with other things and
then OOO.
https://github.com/llvm/llvm-project/pull/75128
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
htt
@@ -821,7 +821,8 @@ void SymbolCollector::setIncludeLocation(const Symbol &S,
SourceLocation DefLoc,
// Use the expansion location to get the #include header since this is
// where the symbol is exposed.
- IncludeFiles[S.ID] = SM.getDecomposedExpansionLoc(DefLoc).first;
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/75128
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet approved this pull request.
thanks!
https://github.com/llvm/llvm-project/pull/71605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kadircet wrote:
hi @5chmidti and @HighCommander4!
it was deliberate to cover `modernize-` checks as they're pretty similar to
`-wdeprecated` in nature, and they're both explicit, user needs to annotate
code or opt-in for particular clang-tidy checks.
feedback we received in the past was, thes
kadircet wrote:
hi @owenca looks like this is still regressing certain patterns, e.g:
```cpp
int foo BAR;
```
annotations before your modifications to `isStartOfName`:
```
AnnotatedTokens(L=0):
M=0 C=0 T=Unknown S=1 F=0 B=0 BK=0 P=0 Name=int L=3 PPK=2 FakeLParens=
FakeRParens=0 II=0x216ebe0 T
kadircet wrote:
@s1Sharp are there any conclusions here? our code also incidentally relied on
having new lines between string literals, mostly for the sake of having a line
break after string literals that end with `\n`.
what do people think about restoring the functionality to break after str
https://github.com/kadircet created
https://github.com/llvm/llvm-project/pull/76795
This restores a subset of functionality that was forego in
d68826dfbd987377ef6771d40c1d984f09ee3b9e.
Streaming multiple string literals is rare enough in practice, hence
that change makes sense in general. But i
kadircet wrote:
sent out https://github.com/llvm/llvm-project/pull/76795 for implementation
https://github.com/llvm/llvm-project/pull/69859
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm
https://github.com/kadircet approved this pull request.
can you also add a test to clang/unittests/Format/TokenAnnotatorTest.cpp that
ensures trailing attribute-like macros receive `StartOfName` annotation to make
sure we don't regress the signal in the future?
https://github.com/llvm/llvm-pro
https://github.com/kadircet approved this pull request.
thanks, lgtm!
https://github.com/llvm/llvm-project/pull/75904
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/75612
From 041a3396cd62773bac985a6ca0b453b2f14635b3 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Fri, 15 Dec 2023 15:14:05 +0100
Subject: [PATCH 1/2] [clangd] Track IWYU pragmas for non-preamble includes
---
https://github.com/kadircet closed
https://github.com/llvm/llvm-project/pull/75612
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet created
https://github.com/llvm/llvm-project/pull/76826
False negative/positive rate has decreased to the degree that these
extra confirmations no longer provide any value, but only create
friction in the happy case.
When we have false analysis, people usually need t
https://github.com/kadircet approved this pull request.
thanks!
https://github.com/llvm/llvm-project/pull/73913
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/76795
From 18ef1d8901835f5129f775d292425b808f42fe85 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Wed, 3 Jan 2024 09:28:35 +0100
Subject: [PATCH 1/2] [clang-format] Break after string literals with trailing
li
kadircet wrote:
> Can you also add a formatting test?
done
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -504,68 +502,6 @@ TEST_F(ExtractVariableTest, Test) {
int main() {
auto placeholder = []() { return 42; }(); return placeholder ;
})cpp"},
- {R"cpp(
-template
-void foo(Ts ...args) {
- auto x = [[ [&args...]() {} ]];
@@ -422,8 +422,6 @@ TEST_F(ExtractVariableTest, Test) {
int member = 42;
};
)cpp"},
- {R"cpp(void f() { auto x = [[ [](){ return 42; }]]; })cpp",
kadircet wrote:
let's change this to `auto x = +[[ ... ]]`, to make sure
@@ -490,6 +491,13 @@ bool eligibleForExtraction(const SelectionTree::Node *N) {
BO->getRHS() == OuterImplicit.ASTNode.get())
return false;
}
+ if (const auto *Decl = Parent->ASTNode.get()) {
+if (!Decl->isInitCapture() &&
kadircet wrote:
i
@@ -27,10 +27,10 @@ TEST_F(ExtractVariableTest, Test) {
return t.b[[a]]r]]([[t.z]])]];
}
void f() {
- int a = [[5 +]] [[4 * xyz]]();
+ int a = 5 + [[4 * xyz]]();
// multivariable initialization
if(1)
-int x = [[1
@@ -504,68 +502,6 @@ TEST_F(ExtractVariableTest, Test) {
int main() {
auto placeholder = []() { return 42; }(); return placeholder ;
})cpp"},
- {R"cpp(
kadircet wrote:
again you can keep this test around by prepending a `+` to t
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/76826
From 5e9a851584dcfd730fda7d85b54101ebea89f8a3 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Wed, 3 Jan 2024 16:06:13 +0100
Subject: [PATCH 1/2] [clangd] Dont require confirmation for include-cleaner
batc
@@ -237,18 +236,6 @@ removeAllUnusedIncludes(llvm::ArrayRef
UnusedIncludes) {
Diag.Fixes.front().Edits.begin(),
Diag.Fixes.front().Edits.end());
}
-
- // TODO(hokein): emit a suitable text for the label.
- ChangeAnnotat
kadircet wrote:
> This change makes sense for removing all unused includes (as all these unused
> includes are visible in the editor). For missing includes, they are less
> obvious, but it is probably fine.
The rationale for missing includes was the same, when things go wrong it's
usually obs
kadircet wrote:
oh sorry, this should ofc work with include-cleaner fixes, as we actually
provide these as edits, instead of commands, as we do with our usual tweaks.
https://github.com/llvm/llvm-project/pull/76826
___
cfe-commits mailing list
cfe-com
https://github.com/kadircet closed
https://github.com/llvm/llvm-project/pull/76826
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet updated
https://github.com/llvm/llvm-project/pull/76795
From 18ef1d8901835f5129f775d292425b808f42fe85 Mon Sep 17 00:00:00 2001
From: Kadir Cetinkaya
Date: Wed, 3 Jan 2024 09:28:35 +0100
Subject: [PATCH 1/3] [clang-format] Break after string literals with trailing
li
kadircet wrote:
ping @HazardyKnusperkeks @owenca this is blocking releases on our side,
anything concerning here?
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/76960
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet approved this pull request.
thanks, lgtm!
https://github.com/llvm/llvm-project/pull/76960
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -215,11 +208,15 @@ class ActionFactory : public
tooling::FrontendActionFactory {
: HeaderFilter(HeaderFilter) {}
std::unique_ptr create() override {
-return std::make_unique(HeaderFilter);
+return std::make_unique(HeaderFilter, EditFiles);
}
+ const l
https://github.com/kadircet edited
https://github.com/llvm/llvm-project/pull/76466
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kadircet commented:
thanks, this LG in direction. only reviewed the pieces leading to in-file
rename so far.
https://github.com/llvm/llvm-project/pull/76466
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.
@@ -1187,6 +1187,16 @@ bool fromJSON(const llvm::json::Value &Params,
RenameParams &R,
O.map("position", R.position) && O.map("newName", R.newName);
}
+llvm::json::Value toJSON(const PrepareRenameResult &PRR) {
+ if (!PRR.placeholder) {
kadircet wro
@@ -1436,6 +1436,14 @@ struct RenameParams {
};
bool fromJSON(const llvm::json::Value &, RenameParams &, llvm::json::Path);
+struct PrepareRenameResult {
+ /// Range of the string to rename.
+ Range range;
+ /// Placeholder text to use in the editor, if set.
+ std::optiona
@@ -53,13 +55,38 @@ struct RenameInputs {
struct RenameResult {
// The range of the symbol that the user can attempt to rename.
Range Target;
+ // Placeholder text for the rename operation, if set.
+ std::optional Placeholder;
// Rename occurrences for the current main
@@ -183,6 +185,8 @@ bool isSpelled(SourceLocation Loc, const NamedDecl &ND) {
if (clang::Lexer::getRawToken(Loc, Tok, SM, LO))
return false;
auto StrName = Name.getAsString();
+ if (const auto *MD = dyn_cast(&ND))
+StrName = MD->getSelector().getNameForSlot(0).str(
@@ -569,8 +571,43 @@ renameWithinFile(ParsedAST &AST, const NamedDecl
&RenameDecl,
// }
if (!isInsideMainFile(RenameLoc, SM))
continue;
+Locs.push_back(RenameLoc);
+ }
+ if (const auto *MD = dyn_cast(&RenameDecl)) {
kadircet wrote:
let's
@@ -134,7 +134,7 @@ class ClangdLSPServer : private ClangdServer::Callbacks,
void onWorkspaceSymbol(const WorkspaceSymbolParams &,
Callback>);
void onPrepareRename(const TextDocumentPositionParams &,
- Callback>);
+
@@ -508,7 +508,8 @@ static bool mayBeValidIdentifier(llvm::StringRef Ident) {
!isAsciiIdentifierStart(Ident.front(), AllowDollar))
return false;
for (char C : Ident) {
-if (llvm::isASCII(C) && !isAsciiIdentifierContinue(C, AllowDollar))
+if (llvm::isASCII(C)
@@ -338,6 +338,10 @@ inline bool isReservedName(llvm::StringRef Name) {
SourceLocation translatePreamblePatchLocation(SourceLocation Loc,
const SourceManager &SM);
+clangd::Range tokenRangeForLoc(SourceLocation TokLoc,
@@ -53,13 +55,38 @@ struct RenameInputs {
struct RenameResult {
// The range of the symbol that the user can attempt to rename.
Range Target;
+ // Placeholder text for the rename operation, if set.
+ std::optional Placeholder;
kadircet wrote:
same here,
@@ -71,8 +98,8 @@ llvm::Expected rename(const RenameInputs
&RInputs);
/// REQUIRED: Occurrences is sorted and doesn't have duplicated ranges.
llvm::Expected buildRenameEdit(llvm::StringRef AbsFilePath,
llvm::StringRef InitialCode,
-
@@ -569,8 +571,43 @@ renameWithinFile(ParsedAST &AST, const NamedDecl
&RenameDecl,
// }
if (!isInsideMainFile(RenameLoc, SM))
continue;
+Locs.push_back(RenameLoc);
+ }
+ if (const auto *MD = dyn_cast(&RenameDecl)) {
+auto Code = SM.getBufferData(SM.ge
@@ -893,22 +964,36 @@ llvm::Expected buildRenameEdit(llvm::StringRef
AbsFilePath,
return LastOffset;
};
- std::vector> OccurrencesOffsets;
- for (const auto &R : Occurrences) {
-auto StartOffset = Offset(R.start);
-if (!StartOffset)
- return StartOffset.t
@@ -53,13 +55,38 @@ struct RenameInputs {
struct RenameResult {
// The range of the symbol that the user can attempt to rename.
Range Target;
+ // Placeholder text for the rename operation, if set.
+ std::optional Placeholder;
// Rename occurrences for the current main
@@ -569,8 +571,43 @@ renameWithinFile(ParsedAST &AST, const NamedDecl
&RenameDecl,
// }
if (!isInsideMainFile(RenameLoc, SM))
continue;
+Locs.push_back(RenameLoc);
+ }
+ if (const auto *MD = dyn_cast(&RenameDecl)) {
+auto Code = SM.getBufferData(SM.ge
1 - 100 of 851 matches
Mail list logo