Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C-family commit b564b5d doesn't recongnize functions #2699

Closed
snorez opened this issue Jun 30, 2017 · 7 comments
Closed

C-family commit b564b5d doesn't recongnize functions #2699

snorez opened this issue Jun 30, 2017 · 7 comments

Comments

@snorez
Copy link

snorez commented Jun 30, 2017

OS: ubuntu 16.04

Today I update ycm to the latest b564b5d, and download llvm_clang 4.0.1, then rebuild ycm_core. I have done this several times.

When all done, I tried a .c file.
printf, then trigger ycm, it shows printf v or printf [id].

I have to set the HEAD back to 19a6a55. use llvm_clang 4.0.1, rebuild, ycm works very well.

@micbou
Copy link
Collaborator

micbou commented Jun 30, 2017

I don't see the problem. Could you explain it better?

@micbou
Copy link
Collaborator

micbou commented Jun 30, 2017

Are you using the <C-Space> key to trigger semantic completions? If so, what is the value returned by the command:

:imap <C-Space>

?

@snorez
Copy link
Author

snorez commented Jun 30, 2017

@micbou sorry for responding late.
here is my ycm configs
screenshot from 2017-06-30 21-59-51

I don't know how to explain it, cause ycm didn't give any error messages.
the differences between them is

printf|

"|" where ths cursor is. then trigger ycm, on my system, I press "\\"(twice), I set <leader> = backslash.
b564b5d shows:
printf v or printf [id]. :YcmDebugInfo and some other commands have no err.
before b564b5d, I was using 19a6a55, which shows

printf( const char *restrict __format, ... )
__PTHREAD_RWLOCK_INT_FLAGS_SHARED
fprintf( FILE *...
...

@micbou
Copy link
Collaborator

micbou commented Jun 30, 2017

Thanks, I understand the issue now. Since PR #2657, YCM doesn't set its omnifunc (youcompleteme#OmniComplete) anymore, so your mapping:

inoremap <leader><leader> <C-x><C-o><C-p>

invokes the default Vim omnifunc ccomplete#Complete instead of YCM semantic completion. You need to set the g:ycm_key_invoke_completion option to your <leader><leader> mapping:

let g:ycm_key_invoke_completion = '<leader><leader>'

@micbou
Copy link
Collaborator

micbou commented Jun 30, 2017

Also, this line:

inoremap <expr><CR> pumvisible()?"\<C-y>":"\<CR>"

in your vimrc, that closes the completion menu when pressing enter, won't work anymore. You need to replace it with the g:ycm_key_list_stop_completion option:

let g:ycm_key_list_stop_completion = ['<C-y>', '<CR>']

You can remove <C-y> from the list if you don't use it.

@snorez
Copy link
Author

snorez commented Jun 30, 2017

@micbou thank you so much, I thought something missing but there are so many commits between these two. I just try the newest one, and modify these two lines, it works now. Thanks again.
BTW, is there a place/file we could find the infomation(e.g. some options are obsolete or changed) when we update ycm (like CHANGED)?

@micbou
Copy link
Collaborator

micbou commented Jun 30, 2017

No, there isn't. We may consider adding a changelog file in the future.

@micbou micbou closed this as completed Jun 30, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants