I'd like to investigate implementing https://youtrack.jetbrains.com/issue/IDEA-86569, i.e., while debugging, the `Navigate -> Declaration` (⌘B) action should go to the declaration for the actual runtime type instead of the compile-time static type.
Could this feature be implemented as a plugin, or must I modify the IntelliJ codebase?
It seems that `Navigate -> Declaration` is implemented by `com.intellij.codeInsight.navigation.actions.GotoDeclarationAction$invoke(…)`, but, when I debugged IntelliJ to track things down, it used a cache of usage-to-declaration mappings.
What IntelliJ IDEA code from the GitHub repo (https://github.com/JetBrains/intellij-community) initially determines the declaration for a usage?
I'll need to implement a `GotoDeclarationHandler` to avoid the existing cached static usage-to-declaration mappings, right?
It seems like I'll need to investigate `com.intellij.debugger.codeinsight.RuntimeTypeEvaluator` to find out the runtime type of an object, correct?
FYI, I haven't previously written any IntelliJ IDEA plugins, or worked with the IntelliJ code base.
Thanks for any help.