Golevka / emacs-clang-complete-async

An emacs plugin to complete C and C++ code using libclang
360 stars 71 forks source link

auto complete clang async conflicts with builtin sources #80

Open zhuzhongshu opened 9 years ago

zhuzhongshu commented 9 years ago

When I using "auto complete clang async" together with auto-complete's built in sources in Emacs C++ mode, the auto complete candidates doesn't contain the clang completion. I have to manually use the command ac-complete-clang-async to get proper completions. But other user defined sources such as as-ispell and ac-octave works well. How can I solve this problem?

oracleyue commented 9 years ago

I encountered it, too. I try many ways suggested on other website, like changing the position of config codes in .emacs. They failed to work for me. I suggest a solution, at least it works for me. Turn off the ac-auto-start by typing characters. I guess it is difficult for the author to control which one (build-in or clang completion, and other more completion modes) is last one to be listed (I remembered on a bbs about emacs, someone mentioned it). If automatically start ac by setting the number of charachers, the build-in list will flush the clang completion. Usually you do not need C-TAB, even TAB. You use TAB only when you need to complete yasnippet or build-in list, words in the buffer by ac, while the clang list will be shown automatically when you type . or ->, ::, etc. (sometimes you need to hit TAB or C-TAB, if you cancel the ac-popup list by mistakes while you want them again after some characters following ., ->. I usually hit C-TAB, only when TAB also fails. I remember it only happens in Python mode (since TAB in python mode is bound to more actions), not in C/C++.)

(setq ac-auto-start nil)
(ac-set-trigger-key "TAB")    ;; new
(define-key ac-mode-map [(control tab)] 'auto-complete)
zhuzhongshu commented 9 years ago

多谢,我也是这样处理的,不过我还是给clang-async源设置了快捷键C-tab,这样可以用来补全非成员函数,,