Hacker News new | ask | show | jobs
by webaholic 3674 days ago
What do people use to get something like this for C/C++? Also is there any package for auto-completion in C/C++?
8 comments

Eclipse CDT (Juno) does it even better. Just hover a mouse over any function call and you can see the body of that function in a scrollable tooltip. You don't need to jump back and forth - you simply follow the code logic and see what the called function does in a tooltip window. This is a huge productivity boost for me and I haven't seen any other IDE doing it.

One other thing no other tool does (AFAIK) is that you can get a "call hierarchy" for a function or any variable and it's laid out as a tree and you can expand each node to trace the calls. This makes understanding the code and refactoring faster by an order of magnitude.

I have avoided Eclipse for years because of cpu/memory usage, but ever since I got a computer with Intel i7 CPU and 16GB of RAM, I have completely switched to Eclipse because it makes me so much more productive than any other environment I tried.

RTags works pretty well and always jump to the right definition for me. You pass it to a compilation database json file that you can make using CMake. It runs in the background as a daemon and provides robust go-to-definition as well as autocomplete for both C and C++.

https://github.com/Andersbakken/rtags

EmacsTags + CompanyMode and you should be good to go. You'll need to install the correct tags package for your system, but it's only about 10 minutes of minor annoyance.

Whenever the point is over a word in a C++ codebase, e.g. FooSystem, it will be underlined, and you can click on it and jump to definition, show all references, etc. Then if you type Foo, CompanyMode should pop up a dialog box that will autocomplete FooManager.

I think you can also install a fuzzy matching package for CompanyMode which allows you to type e.g. "FSy" to complete "FooSystem", though I may be confusing Helm and CompanyMode.

You may also want to check out the Projectile package. It's for large project navigation, and I think it helps with automatically running ETags / GTags on an as-needed basis.

CEDET could be replacement, although sometimes very slow, and requires customization for complex projects. I made it working with Java as well, but for last 2 years, I didn't have a chance to contribute anymore, and my fork with better Java support is outdated...

I wrote an article that should be introduction to CEDET: http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html - maybe it will be useful

I prefer https://github.com/abingham/emacs-ycmd – the engine is also used by the corresponding vim plugin. Gives completion and "jump to".

Rtags is a also nice alternative. Both packages work as daemons outside emacs that read your compile commands.

Thanks! This worked the best out of all...
Relies on cmake integration but worth a look: https://github.com/atilaneves/cmake-ide