[clang-tools-extra] [clangd] Update XRefs to support overriden ObjC methods (PR #127109)

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 14 02:20:11 PST 2025


================
@@ -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.
----------------
kadircet wrote:

what about the interaction in the other direction? i.e. we're on the protocol declaration and try to do a go-to-definition.

moreover this is going to make go-to-defn on references to a symbol quite chatty (now you'll have both the definition in implementation and definition in protocol as an alternative). I think we want to limit this to only when user triggered the interaction on the definition of the method and not references to it (similar to c++ code path above).

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


More information about the cfe-commits mailing list