我使用 CLion 在*.c
文件中主要编写 C 代码。如何禁用 IDE 将代码解释为代码导航功能的 C++,以便我可以仅按名称导航符号,而忽略函数调用中使用的参数?我想要一个更像 Vim 的体验,比如 usingsctags
和cscope
,这样当我重构函数返回类型和参数时,IDE 就不会丢失。
还是我应该接受它的工作方式并更多地依赖它提供的各种重构向导?
我使用 CLion 在*.c
文件中主要编写 C 代码。如何禁用 IDE 将代码解释为代码导航功能的 C++,以便我可以仅按名称导航符号,而忽略函数调用中使用的参数?我想要一个更像 Vim 的体验,比如 usingsctags
和cscope
,这样当我重构函数返回类型和参数时,IDE 就不会丢失。
还是我应该接受它的工作方式并更多地依赖它提供的各种重构向导?
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.