Golevka / emacs-clang-complete-async

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

Fix an error expanding arguments for overridden methods in C++. #43

Open toojays opened 11 years ago

toojays commented 11 years ago

When returning a completion for a method which is implemented in a base class, the name of the class where the method was declared is included, so that instead of:

COMPLETION: what : [#const char *#]what() const

we receive:

COMPLETION: what : [#const char *#]Implementation::what() const

The extra semi-colons after the class name caused this completion to match a regexp which was added in hara/auto-complete-clang@4939442 (and merged in Golevka/emacs-clang-complete-async@3176ea3) to support Objective C. In this case, the argument list in the above example would be determined to be ":what() const" rather than just "()". This commit fixes the issue by avoiding that regexp unless we are in Objective C mode.

This fixes Golevka/emacs-clang-complete-async#39.