https://github.com/DavidGoldman closed
https://github.com/llvm/llvm-project/pull/82061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/DavidGoldman requested changes to this pull request.
Thanks for the fix! Looks good besides some minor nits.
https://github.com/llvm/llvm-project/pull/82061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.o
@@ -605,12 +607,12 @@ findAllSelectorPieces(llvm::ArrayRef
Tokens,
auto PieceCount = SelectorPieces.size();
if (PieceCount < NumArgs &&
isMatchingSelectorName(Tok, Tokens[Index + 1], SM,
- Sel.getNameForSlot(PieceCount))) {
https://github.com/DavidGoldman edited
https://github.com/llvm/llvm-project/pull/82061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -35,6 +35,56 @@ struct RenameOptions {
bool RenameVirtual = true;
};
+/// A name of a symbol that should be renamed.
+///
+/// Symbol's name can be composed of multiple strings. For example, Objective-C
+/// methods can contain multiple argument labels:
+///
+/// \code
+/
https://github.com/DavidGoldman closed
https://github.com/llvm/llvm-project/pull/127109
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/127109
>From d335931b8923005d2ffc580c5195b7fa997f3649 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Thu, 13 Feb 2025 13:51:05 -0500
Subject: [PATCH 1/7] [clangd] Update XRefs to support overriden ObjC methods
@@ -430,6 +439,27 @@ locateASTReferent(SourceLocation CurLoc, const
syntax::Token *TouchedIdentifier,
continue;
}
}
+// Special case: - (void)^method {} should jump to overrides, but the decl
+// shouldn't, only the definition. Note that an Objective-
@@ -430,6 +439,22 @@ locateASTReferent(SourceLocation CurLoc, const
syntax::Token *TouchedIdentifier,
continue;
}
}
+// Special case: - (void)^method; should jump to all overrides. Note that
an
+// Objective-C method can override a parent class or pr
DavidGoldman wrote:
> i am not sure if it does, e.g.
> https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/DeclObjC.cpp#L1268-L1273
> stops at the first overridden method.
>
> maybe you can add some unittests for this as well ?
Done, you're right, so fixed that as well.
> i think us
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/127109
>From d335931b8923005d2ffc580c5195b7fa997f3649 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Thu, 13 Feb 2025 13:51:05 -0500
Subject: [PATCH 1/5] [clangd] Update XRefs to support overriden ObjC methods
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/127109
>From d335931b8923005d2ffc580c5195b7fa997f3649 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Thu, 13 Feb 2025 13:51:05 -0500
Subject: [PATCH 1/3] [clangd] Update XRefs to support overriden ObjC methods
DavidGoldman wrote:
> can you also add some tests to `SymbolCollectorTests.cpp` to make sure we
> capture `overriddenby` relationships relevant to your use cases?
>
> index tests in `XRefsTests.cpp` uses rather dynamic-index hence can have
> different characteristics then you'd get for the sta
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/127109
>From d335931b8923005d2ffc580c5195b7fa997f3649 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Thu, 13 Feb 2025 13:51:05 -0500
Subject: [PATCH 1/4] [clangd] Update XRefs to support overriden ObjC methods
@@ -430,6 +430,18 @@ locateASTReferent(SourceLocation CurLoc, const
syntax::Token *TouchedIdentifier,
continue;
}
}
+// Special case: an Objective-C method can override a parent class or
+// protocol.
DavidGoldman wrote:
I was thinki
@@ -1283,6 +1295,17 @@ std::vector findImplementations(ParsedAST
&AST, Position Pos,
} else if (const auto *RD = dyn_cast(ND)) {
IDs.insert(getSymbolID(RD));
QueryKind = RelationKind::BaseOf;
+} else if (const auto *OMD = dyn_cast(ND)) {
+ IDs.insert(g
@@ -1438,6 +1461,15 @@ ReferencesResult findReferences(ParsedAST &AST, Position
Pos, uint32_t Limit,
getOverriddenMethods(CMD, OverriddenMethods);
}
}
+// Special case: Objective-C methods can override a parent class or
+// protoco
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/127109
>From d335931b8923005d2ffc580c5195b7fa997f3649 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Thu, 13 Feb 2025 13:51:05 -0500
Subject: [PATCH 1/2] [clangd] Update XRefs to support overriden ObjC methods
https://github.com/DavidGoldman created
https://github.com/llvm/llvm-project/pull/127109
- Support finding implementors of a protocol and discovering subclasses for
ObjC interfaces via the implementations call
- Add tests
>From d335931b8923005d2ffc580c5195b7fa997f3649 Mon Sep 17 00:00:00 2001
https://github.com/DavidGoldman approved this pull request.
https://github.com/llvm/llvm-project/pull/88446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/81775
>From b0a2fb25c25ecfb20bb3f0aab2d398ea80caeff2 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Fri, 26 Jan 2024 15:50:11 -0500
Subject: [PATCH 1/6] Add support for ObjC property renaming + implicit
prope
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/81775
>From b0a2fb25c25ecfb20bb3f0aab2d398ea80caeff2 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Fri, 26 Jan 2024 15:50:11 -0500
Subject: [PATCH 1/5] Add support for ObjC property renaming + implicit
prope
https://github.com/DavidGoldman closed
https://github.com/llvm/llvm-project/pull/83867
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/DavidGoldman created
https://github.com/llvm/llvm-project/pull/83867
This will give us insight into what users are renaming in practice - for
instance, try to gauge the impact of the ObjC rename support.
>From 42dddf4a5fbd862bf2f122a6c6216fe0dbd34e54 Mon Sep 17 00:00:00 2001
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/81775
>From b0a2fb25c25ecfb20bb3f0aab2d398ea80caeff2 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Fri, 26 Jan 2024 15:50:11 -0500
Subject: [PATCH 1/4] Add support for ObjC property renaming + implicit
prope
https://github.com/DavidGoldman closed
https://github.com/llvm/llvm-project/pull/82396
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/82396
>From 8a9c09575ed143e762faa7abf48285ed6b4b0335 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 20 Feb 2024 13:14:26 -0500
Subject: [PATCH 1/3] [clangd] Fix renaming single argument ObjC methods
Add
@@ -811,8 +811,14 @@ renameWithinFile(ParsedAST &AST, const NamedDecl
&RenameDecl,
continue;
Locs.push_back(RenameLoc);
}
- if (const auto *MD = dyn_cast(&RenameDecl))
-return renameObjCMethodWithinFile(AST, MD, NewName, std::move(Locs));
+ if (const auto *MD
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/82396
>From 8a9c09575ed143e762faa7abf48285ed6b4b0335 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 20 Feb 2024 13:14:26 -0500
Subject: [PATCH 1/2] [clangd] Fix renaming single argument ObjC methods
Add
https://github.com/DavidGoldman created
https://github.com/llvm/llvm-project/pull/82396
Use the legacy non-ObjC rename logic when dealing with selectors that have zero
or one arguments. In addition, make sure we don't add an extra `:` during the
rename.
Add a few more tests to verify this wor
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/81775
>From 7a3859fc5f5f52fb283fd0b2feda57521ca88240 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Fri, 26 Jan 2024 15:50:11 -0500
Subject: [PATCH 1/4] Add support for ObjC property renaming + implicit
prope
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/81775
>From 7a3859fc5f5f52fb283fd0b2feda57521ca88240 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Fri, 26 Jan 2024 15:50:11 -0500
Subject: [PATCH 1/3] Add support for ObjC property renaming + implicit
prope
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/81775
>From 7a3859fc5f5f52fb283fd0b2feda57521ca88240 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Fri, 26 Jan 2024 15:50:11 -0500
Subject: [PATCH 1/2] Add support for ObjC property renaming + implicit
prope
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/81775
>From 7a3859fc5f5f52fb283fd0b2feda57521ca88240 Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Fri, 26 Jan 2024 15:50:11 -0500
Subject: [PATCH] Add support for ObjC property renaming + implicit property
https://github.com/DavidGoldman closed
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/DavidGoldman created
https://github.com/llvm/llvm-project/pull/81775
Add support for renaming Objective-C properties. These are special since a
single property decl could generate 3 different decls - a getter method, a
setter method, and an instance variable. In addition, su
DavidGoldman wrote:
Thanks, PTAL, I'll save the remaining comments for follow ups.
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
@@ -569,8 +840,13 @@ renameWithinFile(ParsedAST &AST, const NamedDecl
&RenameDecl,
// }
if (!isInsideMainFile(RenameLoc, SM))
continue;
+Locs.push_back(RenameLoc);
+ }
+ if (const auto *MD = dyn_cast(&RenameDecl))
+return renameObjCMethodWithinFile(AS
@@ -53,13 +55,34 @@ 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 non-empty.
+ std::string Placeholder;
// Rename occurrences for the current m
@@ -538,11 +564,205 @@ std::optional checkName(const NamedDecl
&RenameDecl,
Conflict->getLocation().printToString(ASTCtx.getSourceManager())};
}
}
- if (Result)
+ if (Result) {
InvalidNameMetric.record(1, toString(Result->K));
+return makeError(*Re
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl
&RenameDecl,
Conflict->getLocation().printToString(ASTCtx.getSourceManager())};
}
}
- if (Result)
+ if (Result) {
InvalidNameMetric.record(1, toString(Result->K));
+return makeError(*Re
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl
&RenameDecl,
Conflict->getLocation().printToString(ASTCtx.getSourceManager())};
}
}
- if (Result)
+ if (Result) {
InvalidNameMetric.record(1, toString(Result->K));
+return makeError(*Re
DavidGoldman wrote:
Done
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/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/9] [clangd][SymbolCollector] Treat ObjC methods as spelled
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/8] [clangd][SymbolCollector] Treat ObjC methods as spelled
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl
&RenameDecl,
Conflict->getLocation().printToString(ASTCtx.getSourceManager())};
}
}
- if (Result)
+ if (Result) {
InvalidNameMetric.record(1, toString(Result->K));
+return makeError(*Re
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl
&RenameDecl,
Conflict->getLocation().printToString(ASTCtx.getSourceManager())};
}
}
- if (Result)
+ if (Result) {
InvalidNameMetric.record(1, toString(Result->K));
+return makeError(*Re
@@ -508,24 +513,46 @@ static bool mayBeValidIdentifier(llvm::StringRef Ident) {
!isAsciiIdentifierStart(Ident.front(), AllowDollar))
return false;
for (char C : Ident) {
+if (AllowColon && C == ':')
DavidGoldman wrote:
This doesn't check the en
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl
&RenameDecl,
Conflict->getLocation().printToString(ASTCtx.getSourceManager())};
}
}
- if (Result)
+ if (Result) {
InvalidNameMetric.record(1, toString(Result->K));
+return makeError(*Re
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl
&RenameDecl,
Conflict->getLocation().printToString(ASTCtx.getSourceManager())};
}
}
- if (Result)
+ if (Result) {
InvalidNameMetric.record(1, toString(Result->K));
+return makeError(*Re
@@ -538,11 +565,254 @@ std::optional checkName(const NamedDecl
&RenameDecl,
Conflict->getLocation().printToString(ASTCtx.getSourceManager())};
}
}
- if (Result)
+ if (Result) {
InvalidNameMetric.record(1, toString(Result->K));
+return makeError(*Re
@@ -508,24 +513,46 @@ static bool mayBeValidIdentifier(llvm::StringRef Ident) {
!isAsciiIdentifierStart(Ident.front(), AllowDollar))
return false;
for (char C : Ident) {
+if (AllowColon && C == ':')
+ continue;
if (llvm::isASCII(C) && !isAsciiIdentifie
https://github.com/DavidGoldman closed
https://github.com/llvm/llvm-project/pull/76410
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/7] [clangd][SymbolCollector] Treat ObjC methods as spelled
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/6] [clangd][SymbolCollector] Treat ObjC methods as spelled
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/5] [clangd][SymbolCollector] Treat ObjC methods as spelled
@@ -38,6 +38,11 @@
namespace clang {
namespace clangd {
+
+std::vector collectRenameIdentifierRanges(
DavidGoldman wrote:
Done
https://github.com/llvm/llvm-project/pull/76466
___
cfe-commits mailing list
cfe-commit
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
+ const syntax::Token &Next,
+ const S
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
+ const syntax::Token &Next,
+ const S
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
+ const syntax::Token &Next,
+ const S
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
+ const syntax::Token &Next,
+ const S
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
+ const syntax::Token &Next,
+ const S
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
+ const syntax::Token &Next,
+ const S
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
+ const syntax::Token &Next,
+ const S
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
DavidGoldman wrote:
Done
https://github.com/llvm/llvm-project/pull/76466
__
@@ -1017,9 +1159,10 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
int LastDLine = 0, LastDColumn = 0;
int Cost = 0;
for (size_t I = 0; I < Indexed.size(); ++I) {
-int DLine = Indexed[I].start.line - Lexed[MappedIndex[I]].start.line;
-int D
@@ -1007,7 +1148,8 @@ std::optional>
getMappedRanges(ArrayRef Indexed,
// diff[0]: line + 1 <- insert a line before edit 0.
// diff[1]: column + 1 <- remove a line between edits 0 and 1, and insert a
// character on edit 1.
-size_t renameRangeAdjustmentCost(ArrayRef Ind
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
+ const syntax::Token &Next,
+ const S
@@ -1029,5 +1172,151 @@ size_t renameRangeAdjustmentCost(ArrayRef
Indexed, ArrayRef Lexed,
return Cost;
}
+static bool isMatchingSelectorName(const syntax::Token &Cur,
+ const syntax::Token &Next,
+ const S
@@ -778,12 +868,44 @@ llvm::Expected rename(const RenameInputs
&RInputs) {
return makeError(ReasonToReject::NoSymbolFound);
if (DeclsUnderCursor.size() > 1)
return makeError(ReasonToReject::AmbiguousSymbol);
+ std::string Placeholder;
+ // We expect the token under
@@ -778,12 +868,44 @@ llvm::Expected rename(const RenameInputs
&RInputs) {
return makeError(ReasonToReject::NoSymbolFound);
if (DeclsUnderCursor.size() > 1)
return makeError(ReasonToReject::AmbiguousSymbol);
+ std::string Placeholder;
+ // We expect the token under
@@ -778,12 +868,44 @@ llvm::Expected rename(const RenameInputs
&RInputs) {
return makeError(ReasonToReject::NoSymbolFound);
if (DeclsUnderCursor.size() > 1)
return makeError(ReasonToReject::AmbiguousSymbol);
+ std::string Placeholder;
+ // We expect the token under
@@ -778,12 +868,44 @@ llvm::Expected rename(const RenameInputs
&RInputs) {
return makeError(ReasonToReject::NoSymbolFound);
if (DeclsUnderCursor.size() > 1)
return makeError(ReasonToReject::AmbiguousSymbol);
+ std::string Placeholder;
+ // We expect the token under
@@ -778,12 +868,44 @@ llvm::Expected rename(const RenameInputs
&RInputs) {
return makeError(ReasonToReject::NoSymbolFound);
if (DeclsUnderCursor.size() > 1)
return makeError(ReasonToReject::AmbiguousSymbol);
+ std::string Placeholder;
+ // We expect the token under
@@ -778,12 +868,44 @@ llvm::Expected rename(const RenameInputs
&RInputs) {
return makeError(ReasonToReject::NoSymbolFound);
if (DeclsUnderCursor.size() > 1)
return makeError(ReasonToReject::AmbiguousSymbol);
+ std::string Placeholder;
+ // We expect the token under
@@ -746,6 +812,30 @@ void findNearMiss(
} // namespace
+SymbolRange::SymbolRange(Range R) : Ranges({R}) {}
+
+SymbolRange::SymbolRange(std::vector Ranges)
+: Ranges(std::move(Ranges)) {}
+
+Range SymbolRange::range() const { return Ranges.front(); }
+
+bool operator==(con
@@ -543,6 +550,45 @@ std::optional checkName(const NamedDecl
&RenameDecl,
return Result;
}
+clangd::Range tokenRangeForLoc(ParsedAST &AST, SourceLocation TokLoc,
+ const SourceManager &SM,
+ const LangOptions &Lang
@@ -543,6 +550,45 @@ std::optional checkName(const NamedDecl
&RenameDecl,
return Result;
}
+clangd::Range tokenRangeForLoc(ParsedAST &AST, SourceLocation TokLoc,
+ const SourceManager &SM,
+ const LangOptions &Lang
@@ -543,6 +550,45 @@ std::optional checkName(const NamedDecl
&RenameDecl,
return Result;
}
+clangd::Range tokenRangeForLoc(ParsedAST &AST, SourceLocation TokLoc,
+ const SourceManager &SM,
+ const LangOptions &Lang
@@ -543,6 +550,45 @@ std::optional checkName(const NamedDecl
&RenameDecl,
return Result;
}
+clangd::Range tokenRangeForLoc(ParsedAST &AST, SourceLocation TokLoc,
+ const SourceManager &SM,
+ const LangOptions &Lang
@@ -681,12 +718,26 @@ renameOutsideFile(const NamedDecl &RenameDecl,
llvm::StringRef MainFilePath,
ExpBuffer.getError().message());
continue;
}
+std::string RenameIdentifier = RenameDecl.getNameAsString();
+std::optional Selector = std::nullopt;
+
@@ -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
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/4] [clangd][SymbolCollector] Treat ObjC methods as spelled
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/3] [clangd][SymbolCollector] Treat ObjC methods as spelled
@@ -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
@@ -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
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/7] [clangd][SymbolCollector] Treat ObjC methods as spelled
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/6] [clangd][SymbolCollector] Treat ObjC methods as spelled
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76466
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/5] [clangd][SymbolCollector] Treat ObjC methods as spelled
https://github.com/DavidGoldman created
https://github.com/llvm/llvm-project/pull/76466
This is based on top of #76410
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/4] [clangd][SymbolCollect
https://github.com/DavidGoldman updated
https://github.com/llvm/llvm-project/pull/76410
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:01 -0500
Subject: [PATCH 1/2] [clangd][SymbolCollector] Treat ObjC methods as spelled
https://github.com/DavidGoldman created
https://github.com/llvm/llvm-project/pull/76410
We'll treat multi-arg methods as spelled once we have full rename support for
them.
>From 4caf5b3c779bf18236b4b0be5bc7147d10339f2b Mon Sep 17 00:00:00 2001
From: David Goldman
Date: Tue, 26 Dec 2023 15:59:
Author: David Goldman
Date: 2023-08-09T15:51:02-04:00
New Revision: 9fe632ba18f1398aa9e6fd531a2ed98fd79eba40
URL:
https://github.com/llvm/llvm-project/commit/9fe632ba18f1398aa9e6fd531a2ed98fd79eba40
DIFF:
https://github.com/llvm/llvm-project/commit/9fe632ba18f1398aa9e6fd531a2ed98fd79eba40.diff
Author: David Goldman
Date: 2023-06-27T16:25:40-04:00
New Revision: a42ce094d90341f88a845740b2e5783060f23e3e
URL:
https://github.com/llvm/llvm-project/commit/a42ce094d90341f88a845740b2e5783060f23e3e
DIFF:
https://github.com/llvm/llvm-project/commit/a42ce094d90341f88a845740b2e5783060f23e3e.diff
Author: David Goldman
Date: 2023-06-26T14:43:37-04:00
New Revision: 1b66840f71030f5d5934e99398a59c3485ba111e
URL:
https://github.com/llvm/llvm-project/commit/1b66840f71030f5d5934e99398a59c3485ba111e
DIFF:
https://github.com/llvm/llvm-project/commit/1b66840f71030f5d5934e99398a59c3485ba111e.diff
Author: David Goldman
Date: 2023-01-09T09:48:30-05:00
New Revision: 042dd99484d6f393cc8a365def250e9d74c24d37
URL:
https://github.com/llvm/llvm-project/commit/042dd99484d6f393cc8a365def250e9d74c24d37
DIFF:
https://github.com/llvm/llvm-project/commit/042dd99484d6f393cc8a365def250e9d74c24d37.diff
Author: David Goldman
Date: 2023-01-09T09:48:29-05:00
New Revision: 814c0bb31660b2441c9a9a6eeaafc2e33c416842
URL:
https://github.com/llvm/llvm-project/commit/814c0bb31660b2441c9a9a6eeaafc2e33c416842
DIFF:
https://github.com/llvm/llvm-project/commit/814c0bb31660b2441c9a9a6eeaafc2e33c416842.diff
Author: David Goldman
Date: 2022-12-06T13:47:07-05:00
New Revision: fc46d6e67fab06d54c8948ebf959d62984116bc3
URL:
https://github.com/llvm/llvm-project/commit/fc46d6e67fab06d54c8948ebf959d62984116bc3
DIFF:
https://github.com/llvm/llvm-project/commit/fc46d6e67fab06d54c8948ebf959d62984116bc3.diff
Author: David Goldman
Date: 2022-12-06T13:47:07-05:00
New Revision: 51f1ae52b0c92a9783e7df328d05b1f95dca74d1
URL:
https://github.com/llvm/llvm-project/commit/51f1ae52b0c92a9783e7df328d05b1f95dca74d1
DIFF:
https://github.com/llvm/llvm-project/commit/51f1ae52b0c92a9783e7df328d05b1f95dca74d1.diff
Author: David Goldman
Date: 2022-11-16T11:09:06-08:00
New Revision: 2d5c4b8f6e040eef33d4f49820868a81c4c9f1e9
URL:
https://github.com/llvm/llvm-project/commit/2d5c4b8f6e040eef33d4f49820868a81c4c9f1e9
DIFF:
https://github.com/llvm/llvm-project/commit/2d5c4b8f6e040eef33d4f49820868a81c4c9f1e9.diff
1 - 100 of 157 matches
Mail list logo