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

Alex Hoppen via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 23 11:32:17 PST 2024


ahoppen wrote:

For some context: When I’m talking about * finding the ranges to rename based on an index that’s not clangd’s built-in index* I meant a request like https://github.com/apple/llvm-project/pull/7973. This allows us to use Apple’s IndexStore to find the locations of symbols to rename and then invoke clangd to get the edits to rename the symbols and deal with the parsing of Objective-C selector pieces. 

Functionality-wise, I would be fine with using a `optional<vector<string>>` instead of `Selector` in `collectRenameIdentifierRanges`. FWIW I disagree that using a `vector<string>` is cleaner than using a dedicated type for it because there’s no type-level information about what the `vector<string>` represents and that `SymbolName` could be made to some day support the cases you mention in https://github.com/llvm/llvm-project/pull/82061#discussion_r1500161008. But I’m new to clangd’s development and will follow your guidance here if you prefer `vector<string>`. 

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


More information about the cfe-commits mailing list