ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.44k stars 2.81k forks source link

The preview window only pops up using <C-space> #1403

Closed danihodovic closed 9 years ago

danihodovic commented 9 years ago

When completing a function using YCM in python the preview window showing parameters only appears if ctrl + space was pressed at the start of the string. It doesn't appear whenever the autocomplete pops up on its own. Is there any way to make the preview window always show parameters?

On a side note: Is it possible for the preview window to show colored syntax instead of white text?

vheon commented 9 years ago

I just tried and I get the preview window on a . as well as with <C-Space>.

danihodovic commented 9 years ago

Yeah seems like the semantic autocomplete shows up using . or <-Space>, I'm wondering if it's possible to use it without those two keys.

vheon commented 9 years ago

Sorry but I'm lost. So the issue is not really an issue because you said that the preview window show up using . and <C-Space> which is the expected behaviour. So what do you want to accomplish?

danihodovic commented 9 years ago

I only started using YCM recently so I'm not sure if I'm using the correct terminology, but it seems like there are two modes of completion: semantic and general(?). When typing normally the general completion pops up and no preview window is shown. When you press <C-space> and start to type the preview window is shown. I was wondering if it was possible for the completion window to appear without having to press <C-space>

vheon commented 9 years ago

The identifier-based engine is the default one (the general one) and it use as candidates the identifier that it found in the current buffer and other open buffer relative to the project. It doesn't know anything about python at all. They are just token extracted using this regex for python. So it is not feasible to grab the doc. When you type <C-Space> or . the semantic engine backed by Jedi is called and therefore we can provide the right candidate for the position and the docs. I hope you have a better picture of how YCM works now :)

danihodovic commented 9 years ago

Yeah thank you. So it's not possible at all to call Jedi instead of the identifier based engine for completion inside .py files?

vheon commented 9 years ago

With <C-Space>. If you intended using the semantic engine by default then the answer is no, and if you ask me, you shouldn't. See #560 for reference anyway. Anyway if all you want is see the doc for some function, since it is not supported at the moment by YCM, you could use vim-jedi and disable the completion stuff and use the rest, like the documentation. Look around the internet, more than one people use it like this even though is not recommended because they could conflict with each other.