Search code examples
macrosc-preprocessorkeyboard-shortcutsclion

How do I expand a macro in CLion, using the keyboard or menus?


How do I expand a macro with CLion other than via the hover window? There doesn't seem to be such an action in the context menu, nor in the Code or Refactor menus. I'm looking for a keyboard-based method (with menu use counting as keyboard-based).

When I search for actions with the word "macro", I get CLion macros, CMake macros, but not C/C++ Preprocessor macros, so no help there.


Solution

  • As @uta notes, one can expand macros in CLion - but the action name is different than what you might used to. It's called an "inlining" of a macro, and it's in the Inline... submenu - both in the right-click menu on your macro, and in the Refactor top-level menu.

    However, it seems that CLion is rather picky about expanding macros it doesn't believe are part of the project, so expect some more hitches.