8

The tool should be able to perform simple tasks like renaming a class or function. It should be usable by cross-platform open source projects, so that rules out anything Visual Studio based. However, proprietary software that is free to use by open source projects is okay, as long as there's a release for all the important platforms(windows, GNU/linux, mac OS X).

The tool should ensure that the refactoring is semantically correct, i.e. it shouldn't just do a plaintext find/replace.

The clang project is working on an API suited for the creation of such tools,

Related stackoverflow question, closed

  • 1
    Why not use Eclipse IDE? – Maria Ines Parnisari Mar 25 '14 at 22:30
  • And that tool should integrate in any C++ IDE? Maybe your expectations are a little bit too high... – Thomas Weller Mar 26 '14 at 15:22
  • You have tagged that open-source. Are you looking for open source tools or are you also looking for commercial tools which can be used freely in open source projects (a model that JetBrains follows)? – Thomas Weller Mar 26 '14 at 15:23
  • I was not aware the eclipse IDE could do that, but then again I've not much dived into eclipse CDT. If CDT can do such things, I think it's a perfectly valid answer to this question! – cib Mar 26 '14 at 16:23
  • Commercial tools that can be freely used in open source projects are fine. – cib Mar 26 '14 at 16:23
5

The Eclipse CDT tool (http://www.eclipse.org/cdt/) would seem to match your requirements.

It has rename facilities, and a number of other refactoring operations.

It is open source itself, so you can use it as you like on open (or closed source).

I doubt its refactoring is semantically correct in a narrow sense. C++ is an extremely complex language and changing it is difficult to do accurately under all circumstances (consider renaming of some templated class whose definition depends on a complex template instantiation). That said, I think the CDT refactoring machinery is based on carefully constructed progam parsing, analysis and transformations implemented using compiler-like methods; it is not "a plaintext find/replace".

I have no personal experience with this tool. However, I do build program transformation tools as a living, including those that transform C++ (but would not be a legitimate answer to the "available refactoring tool" or "free to use on open source" requirements). Having a keen interest in the technology behind such tools, I have personally visited and talked to the people that work on the refactoring aspects of the CDT (Peter Sommerlad's team), and have great respect for their skills in building such tools.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.