[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:43:08 PST 2024


================
@@ -27,19 +31,45 @@ namespace tooling {
 /// //       ^~ string 0 ~~~~~         ^~ string 1 ~~~~~
 /// \endcode
 class SymbolName {
+  llvm::SmallVector<std::string, 1> NamePieces;
----------------
sam-mccall wrote:

I'm a little wary of using this class as:

 - it seems like the design has only been informed by objective-C selectors. It's nice to abstract away difficulties of dealing with names, but this doesn't handle many (scope qualifiers, operator names, UDL-names) and it's not clear how/whether it should. If not, I think clangd is better off without the layer of indirection.
 - it's not really clear what you would *do* with this model (name chunks as strings) other than semi-textual rename. If it's a helper class as part of tooling/refactor/rename's API, it might be helpful if it were named/documented as such.

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


More information about the cfe-commits mailing list