abo-abo / function-args

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

completion not working #37

Closed cneira closed 3 years ago

cneira commented 7 years ago
using namespace std;

struct Foo {
  int field_1;
  int another_field_2;
};
`
void one()
{
  Foo foo;
  foo.      // <-- does not brings up helm complete , just a minibuffer menu that returns (int field_1, int another_field_2 )

}

int main () { std::vector < int > v; std::string s; std::map <int,int> m;

v. //<-- semantic-analyze-possible-completions-default: Cannot find types for ‘std::vector v’ m. //<--- semantic-analyze-possible-completions-default: Cannot find types for ‘std::map m’

}

abo-abo commented 7 years ago

All 3 cases work fine for me (provided I #include <vector>, #include <map>). Simply call moo-complete.

Alternatively, if you want C-M-i (complete-symbol) to work, here's the config:

(add-hook 'c-mode-common-hook 'ora-c-common-hook)
(defun ora-c-common-hook ()
  (add-hook 'completion-at-point-functions 'moo-completion-at-point))
cneira commented 7 years ago

I have added your hooks, I can see the helm completion menu for local data structures for not for STL, for example this simple test is not working for me.

#include <string>
#include <vector>

int main() {

  std::string s;
  std::vector <int> v;
  v.  --> no matches found 
}

I'm on windows using the following system includes

(semantic-add-system-include "C:/cygwin64/lib/gcc/x86_64-w64mingw32/4.9.2/include/" 'c++-mode)