Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code refactoring tools for C, usable on GNU/Linux? FOSS preferable

Variations of this question have been asked, but not specific to GNU/Linux and C. I use Komodo Edit as my usual Editor, but I'd actually prefer something that can be used from CLI. I don't need C++ support; it's fine if the tool can only handle plain C.

I really appreciate any direction, as I was unable to find anything. I hope I'm not forced to 'roll' something myself.

NOTE: Please refrain from mention vim; I know it exists and what its capabilities are. I purposefully choose to avoid vim, which is why I use Komodo (or nano on the servers).

like image 650
J. M. Becker Avatar asked Feb 22 '12 19:02

J. M. Becker


2 Answers

I don't think that a pure console refactoring tool would be nice to use.
I use Eclipse CDT on linux to write and refactor C-Code.
There exists also Xrefactory for Emacs http://www.xref.sk/xrefactory/main.html

if a non console refactoring tool is o.k for you as well.

like image 77
Jan Koester Avatar answered Sep 28 '22 05:09

Jan Koester


C-xrefactory was an open source version of xrefactory, covering C and Java, made available on SourceForge by Marián Vittek under GPLv2.

For those interested, there's an actively maintained c-xrefactory fork on GitHub:

https://github.com/thoni56/c-xrefactory

The goal of the GitHub fork is to refactor c-xrefactory itself, add a test suite, and try to document the original source code (which is rather obscure). Maybe, in the future, also convert it into an LSP C language server and refactoring tool.

C-xrefactory works on Emacs; setup scripts and instructions can be found at the repository. Windows users can run it via WSL/WSL2.

like image 39
Tristano Ajmone Avatar answered Sep 28 '22 07:09

Tristano Ajmone