8

What tools are there that supports refactoring C code (renaming variables, extracting methods, finding method references, ...)

Preferably for a Linux environment, but Windows tools are ok too. If there's something available for emacs, even better!

Puppe
  • 4,855
  • 25
  • 27
  • This question might be useful to you: http://stackoverflow.com/questions/673554/how-can-i-refactor-c-source-code-using-emacs – kdt Nov 11 '09 at 07:36

7 Answers7

6

Netbeans 6.7 and above have reasonably decent basic C (and possibly C++, but haven't tried it) refactoring. I use it when doing the JNI part of one of my projects, and stuff like renaming vars, macros, functions, finding usages of a function all work well. Definitely worth a try, to see if it does the rest of what you want, if you're not wedded to emacs yet.

For emacs, there is xrefactory but I haven't tried it myself.

2

I use Eclipse with CDT as an IDE and find that it works well for refactoring and searching code.

DarthNoodles
  • 390
  • 3
  • 11
1

Old, but not bad is cscope and the GUI frontend kscope.

1

Qt Creator is very fast and useful IDE. It's not only for Qt Framework. You can use it for C and pure C++ projects too. Also it have many refactoring features. It's cross-platform and have vi emulation too. For refactoring features please refer it's documentation.

useraged
  • 1,646
  • 17
  • 34
  • Note, while usable, its not quite perfect for C since using C++ keywords like `template` or `class` will confuse it. – ideasman42 Jul 27 '14 at 06:51
0

Slickedit is good at refactoring.

0

Maybe this previous question could help, at least in speeding up the compile-run cycle.

Fast compiling (or maybe more apt, fast lexical analysis) is one of the things needed to create a system supportive of refactoring.

Community
  • 1
  • 1
Prof. Falken
  • 23,276
  • 18
  • 98
  • 168
  • -1 What does that have to do with refactoring tools? – sleske Jul 25 '11 at 22:24
  • It's related, because one the things that makes refactoring harder is if the compiled language takes a long time to compile or lexically analyze. Especially a factor in large projects. Tcc is extremely fast compared to say GCC. – Prof. Falken Jul 26 '11 at 09:04
  • Yes, you have a point. Maybe you could edit your answer to explain how tcc can help when refactoring? Then my downvote will no longer be necessary. – sleske Jul 26 '11 at 10:07
0

This article discusses some C++ refactoring tools for Visual Studio.

casualcoder
  • 4,526
  • 6
  • 27
  • 35