abingham / emacs-ycmd

Emacs client for ycmd, the code completion system.
MIT License
383 stars 46 forks source link

Completion type is [ID] and not the actual type #432

Closed dmalyuta closed 7 years ago

dmalyuta commented 7 years ago

Consider the following code:

#include <iostream>
#include <eigen3/Eigen/Dense>

int main()
{
  Eigen::Vector3d myVector;
  myV
}

I trigger completion at the end of myV and I get back: image

What I think I should see is myVector -> Eigen::Vector3d in the completion list. Why is this is not what is displayed? Is it a general bug/problem with my setup?

ptrv commented 7 years ago

It's not a bug!

You're completion result comes from the identifier completer not from the filetype (semantic) completer. You trigger semantic completion after ., -> or ::. This is by design. See here: https://github.com/Valloric/ycmd#how-ycmd-works

You can force semantic completion by calling ycmd-toggle-force-semantic-completion or having another function for semantic completion and bind it. See here https://github.com/abingham/emacs-ycmd/issues/183#issuecomment-97988875

Forcing always semantic completion can be slow for larger projects.