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

:YcmDiags does not work. #192

Closed
Mizuchi opened this issue Mar 18, 2013 · 3 comments
Closed

:YcmDiags does not work. #192

Mizuchi opened this issue Mar 18, 2013 · 3 comments

Comments

@Mizuchi
Copy link

Mizuchi commented Mar 18, 2013

I have such code in /tmp/a.cpp::

#include<iostream>
int main() {
    std::cout << "hello, world" << std::endl;
}

When I perform :YcmDiags I got this:

Forcing compilation, this will block Vim until done.
Unable to retrieve diagnostics, see output of `:mes` for details.
No warnings or errors detected

And :mes did not contain more information. Here is debug info:

Printing YouCompleteMe debug information...
-- Flags for /usr/share/vim/vimfiles/doc/youcompleteme.txt loaded from /home/ytj/.vim/.ycm_extr
a_conf.py:
-- ['-Wall', '-Wextra', '-Werror', '-Wc++98-compat', '-Wno-long-long', '-Wno-variadic-macros',
'-fexceptions', '-DNDEBUG', '-DUSE_CLANG_COMPLETER', '-std=c++11', '-x', 'c++', '-I', '/home/yt
j/.vim/.', '-I', '/usr/share/vim/vimfiles/autoload/../python/clang_includes']
-- Has Clang support compiled in: True
-- clang version 3.2 (tags/RELEASE_32/final)

Here is my .vimrc (I removed all other plugins):

source /usr/share/vim/vim73/gvimrc_example.vim
let g:ycm_global_ycm_extra_conf = "/home/ytj/.vim/.ycm_extra_conf.py"

BTW, my vim's version is 7.3.798, python 2.7.3 with archlinux. It seems that completion engine works fine. This issue makes syntastic does not work as well.

@Valloric
Copy link
Member

What did :mes contain (if anything)? Could you paste the output here?

Are you able to get semantic completions for C++ in this file? You should get a list of member of the std namespace upon typing std:: in that file.

@Mizuchi
Copy link
Author

Mizuchi commented Mar 18, 2013

This is what I got from :mes :

Messages maintainer: Bram Moolenaar <[email protected]>
"a.cpp" 4L, 80C
Forcing compilation, this will block Vim until done.
Unable to retrieve diagnostics, see output of `:mes` for details.
No warnings or errors detected

Yes, I could get semantic completions. I got a list of member when I type std::. Only :YcmDiags does not work.

OK, maybe I did not say very clear. Let me give a more specific description.

What steps will reproduce the problem?

  1. create /tmp/a.cpp described above
  2. $ vim /tmp/a.cpp
  3. run :YcmDiags

What is the expected output?
This is a legal c++ source code. I think it should report something like "No Errors".

What do you see instead?

Forcing compilation, this will block Vim until done.
Unable to retrieve diagnostics, see output of `:mes` for details.
No warnings or errors detected

@Valloric
Copy link
Member

Interesting... I can reproduce this. If I change the contents of the file to the following, then it works (notice the extra newline between the function and the include):

#include<iostream>

int main() {
    std::cout << "hello, world" << std::endl;
}

So this seems like it might be a clang bug or something? It's not a YCM bug, that's for sure (thus closing).

Anyway, just add that extra newline.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 27, 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