[clang] [clang-tools-extra] [clangd] Use `SymbolName` to represent Objective-C selectors (PR #82061)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 22 18:18:37 PST 2024


sam-mccall wrote:

I don't know that this class brings enough value to warrant the dependency - we don't really seem to be simplifying the code, we're mostly just using it as a fancy `vector<string>`.

(For some context: we went to some effort in the past to untangle this from tooling/Refactoring/Rename, and a lot of pieces of clangd make tradeoffs between keeping design simple and handling all the special cases of C, C++, ObjC precisely).

Is the underlying goal here to be able to use `adjustRenameRanges` from outside of clangd? (That's my reading of "finding the ranges to rename based on an index that’s not clangd’s built-in index" - if you were doing this inside clangd, ISTM you'd have a Selector regardless of the index used).
We don't use the selector for anything other than the text chunks it contains, so I think you could just replace `optional<Selector>` with `optional<vector<StringRef>>` there.

(I don't think there are any plans to make use of Selector in other ways, @kadircet @DavidGoldman would know)

https://github.com/llvm/llvm-project/pull/82061


More information about the cfe-commits mailing list