You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在CLion中查看类或成员的类层级结构?对应操作指令是什么?

Viewing Class & Member Hierarchies in CLion

Great question! CLion has dedicated actions to quickly inspect inheritance hierarchies for both classes and their members. Here's exactly what you need to do depending on your use case:

When working with a class name (cursor on the class definition)

If you want to see the full inheritance chain—both the classes your target inherits from (superclasses) and the classes that inherit from it (subclasses)—use the Type Hierarchy action:

  • Default shortcuts:
    • Windows/Linux: Ctrl + H
    • macOS: Cmd + H
      Once the hierarchy window opens, you can toggle between viewing only supertypes, only subtypes, or both using the buttons at the top of the window (look for icons like an upward arrow, downward arrow, or both arrows combined).

When working with a member (e.g., a method or property, cursor on its name)

For inspecting the hierarchy of overridden/overriding methods (or inherited properties), use the Method Hierarchy action:

  • Default shortcuts:
    • Windows/Linux: Ctrl + Shift + H
    • macOS: Cmd + Shift + H
      This will show you all implementations of the member across the inheritance tree—from the original superclass definition down to the most specific subclass overrides, and vice versa.

Quick tip:

If you can't remember the shortcuts, you can always open the Action Search (press Ctrl + Shift + A on Windows/Linux, Cmd + Shift + A on macOS) and type the action name (Type Hierarchy or Method Hierarchy) to run it directly.

内容的提问来源于stack exchange,提问作者einpoklum

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 08:39:07