abo-abo / function-args

C++ completion for GNU Emacs
120 stars 10 forks source link

Cannot find cout on OSX 10.12 #38

Open rnikoopour opened 7 years ago

rnikoopour commented 7 years ago

I'm trying to follow along on the example to show moo-complete options for std::cout

When I type in s and do M-o it can find std.

When I'm at std::cout. and push M-o for moo-complete I get the following error:

Cannot find definition for "cout"

I added the following to my .emacs:

(fa-config-default)
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
(set-default 'semantic-case-fold t)
(semantic-add-system-include "/usr/local/include/c++/6.3.0" 'c++-mode)
abo-abo commented 7 years ago

I have this in my config to improve the parse:

(dolist (x (list "/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h"
                 "/usr/local/include/boost/test/unit_test_suite.hpp"))
  (add-to-list 'semantic-lex-c-preprocessor-symbol-file x))

Basically, all places where there are a bunch of macros should be passed to semantic-lex-c-preprocessor-symbol-file.

I tried https://github.com/Sarcasm/irony-mode a few days ago, it's much faster than semantic and very precise. I suggest you try it too.