1

I have just started using emacs, after coming from using Xcode. I would like to get code completion for C++, however there are a whole bunch of things that don't really explain what they do (at least not to someone who is used to things just working)

I've looked at irony-mode and company but can't seem to get them to work, and the documentation seems to be awful for irony-mode, I'm not even sure what it does. Company-mode seems to be responsible for displaying the small popup rather than jarringly opening a new frame.

I'm not sure what backend I need for company, I'd have though clang would be enough, but while I'm not sure if I enabled that correctly, no matter what I did I couldn't get the completion popup to show.

I also found helm, and have no idea what that does differently to eithe rof the two above.

Is there a simply guide, or just any documentation for irony-mode that will help me. I really feel like I'm missing something obvious because it can't be this complicated to get code completion when every IDE has it out of the box.

Jonathan.
  • 111
  • 3
  • [this](http://emacs.stackexchange.com/questions/9434/how-to-look-up-documentation-for-a-minor-mode) may be helpful. Also, take a look at [rtags](https://github.com/Andersbakken/rtags). helm is something completely different. – xuhdev Apr 26 '16 at 18:20
  • If you want to have nice things by default, consider [spacemacs](https://github.com/syl20bnr/spacemacs). – xuhdev Apr 26 '16 at 18:22
  • ah yeah, another thing is rtags, is that instead of irony-mode or company-mode or in addition? – Jonathan. Apr 26 '16 at 18:27
  • also how is helm different when it is is described as incremental completions? – Jonathan. Apr 26 '16 at 18:29
  • company-mode is only a completion framework: how things are completed are determined by backends. rtags also provide a backend for it. Helm is for something completely different: with `helm`, `M-x`, `C-x C-f` `recentf`, etc. show you a completion popup for the minibuffer. It is not for C++. – xuhdev Apr 26 '16 at 18:41
  • ok, so what is the difference between rtags, irony and the built in clang backend for company – Jonathan. Apr 26 '16 at 19:05
  • I finally got irony and company to work, but i can't auto complete some symbols from other file in my project, only ones that have been #included? – Jonathan. Apr 26 '16 at 19:12
  • Most kinds of whatever-tags are based on regular expressions and aren't very precise when it comes to figuring out where the declaration was, so context-sensitive completion isn't very good. Irony, on the other hand, is always correct, but if the code can't be parsed, you won't have any results. There's also Semantic, that can do context-sensitive completions, but I've heard it's too slow. – wvxvw Apr 26 '16 at 19:12
  • @wvxvw, is there no indexing type solution that IDEs like xcode use? – Jonathan. Apr 26 '16 at 19:14
  • The index solution is rtags, but it requires you to create projects (CMakeLists.txt) to make use of the indexing, even for single files, like an IDE. – xuhdev Apr 26 '16 at 19:16
  • https://github.com/Sarcasm/company-irony. The link to this is right at the top of irony-mode's README. – Dmitry Apr 28 '16 at 00:40
  • @Dmitry, yes I have installed that – Jonathan. Apr 28 '16 at 11:30
  • What does irony add that rtags doesn't? Shoudl i install company, irony, and rtags, or would just company and rtags suffice? – Jonathan. Apr 28 '16 at 11:31
  • That's not a question for StackExchange. See e.g. https://www.reddit.com/r/emacs/comments/3y6czz/emacs_and_cc_irony_or_rtags_orboth/ – Dmitry Apr 28 '16 at 21:40

0 Answers0