0

I'm using CLion to write mostly C code, in *.c files. How may I disable the IDE from interpreting the code as C++ for the code navigation feature, so that I can navigate symbols by name only, disregarding the parameters used in function calls? I'd like a more Vim-like experience, like when usings ctags and cscope, so that when I'm refactoring functions return types and parameters the IDE don't get lost.

Or should I just accept it's the way it works and rely more heavily on the various refactor wizards it provides?

Spidey
  • 2,508
  • 2
  • 28
  • 38
  • It's not very clear what behavior you want. How do you see that it's interpreting C as C++ (is the language set in CMakeLists)? How is the current navigation different? – Victor Sergienko Aug 09 '19 at 21:34
  • I want ctags like behavior, where only the symbol name is relevant for finding references or implementation. – Spidey Aug 10 '19 at 06:39

1 Answers1

1

As for this moment, ctags-like navigation doesn't exist in CLion: cscope/ctags navigation in Intellij Idea vim plugin.

Your assumption that IDE is parsing the C code as C++ is either based on an error in the project's CMakeLists.txt or is simply wrong. It uses correct C syntax to navigate C code. Probably you mean C linking rules, where only function name matters.

Yes, I advice that you try the built-in refactorings. They may choke on #ifdef-ed out code, because parsing ALL the variants of conditional compilation at the same time is hardly doable, but they are good. You might never look back.

Victor Sergienko
  • 13,115
  • 3
  • 57
  • 91