YouCompleteMe icon indicating copy to clipboard operation
YouCompleteMe copied to clipboard

some questions using YCM with compile_commands.json

Open feng-jianwei opened this issue 2 years ago • 6 comments

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

  • [x] I have read and understood YCM's [CONTRIBUTING]cont document.
  • [x] I have read and understood YCM's [CODE_OF_CONDUCT]code document.
  • [x] I have read and understood YCM's [README]readme, especially the [Frequently Asked Questions]faq section.
  • [x] I have searched YCM's issue tracker to find issues similar to the one I'm about to report and couldn't find an answer to my problem. (Example Google search.)
  • [x] If filing a bug report, I have included the output of vim --version.
  • [x] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [x] If filing a bug report, I have attached the contents of the logfiles using the :YcmToggleLogs command.
  • [x] If filing a bug report, I have included which OS (including specific OS version) I am using.
  • [x] If filing a bug report, I have included a minimal test case that reproduces my issue, using vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what I expected to happen and what actually happened.
  • [x] If filing a installation failure report, I have included the entire output of install.py (or cmake/make/ninja) including its invocation
  • [x] I understand this is an open-source project staffed by volunteers and that any help I receive is a selfless, heartfelt gift of their free time. I know I am not entitled to anything and will be polite and courteous.
  • [x] I understand my issue may be closed if it becomes obvious I didn't actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key questions:

  • What did you do?
  1. I generated the compile_commands.json using cmake "cmake -B target"
  2. Edit a cpp file using vim
  3. answer the question with option 'C'
  4. i find mistakes like "file can't be found " .etc, but the clangd is working which is confirmed by using YcmDebugInfo subcommands.
  5. The windows are list below, l have no idea to solve them and need help image

image-20220801221221276

image-20220801221421562

image-20220801221919177

image-20220801222309000

*** config for YCM***

image-20220801222435009

  1. vim -Nu /path/to/YCM/ycm_vimrc_minimal
  2. :edit test.py
  3. Enter insert mode and type .....

Include description of a minimal test case, including any actual code required to reproduce the issue.

If you made changes to vimrc_ycm_minimal, pase them here:

<contents of ycm_vimrc_minimal>
  • What did you expect to happen?

Include description of the expected behaviour.

  • What actually happened?

Include description of the observed behaviour, including actual output, screenshots, etc.

Diagnostic data

Output of vim --version

fjw@MacBook-Pro cpp % [remotes/origin/master~1] vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, 编译于 Jul 12 2022 16:34:31)
macOS 版本 - arm64
包含补丁: 1-50
编译者 Homebrew
巨型版本 无图形界面。  可使用(+)与不可使用(-)的功能:
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby              +wildignore
+cursorbind        +lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            -X11
+digraphs          +mouse             -sound             -xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        -mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static

Output of YcmDebugInfo

Paste output here

Output of YcmDiags

Paste output here

Output of git rev-parse HEAD in YouCompleteMe installation directory

paste output here

Contents of YCM, ycmd and completion engine logfiles

Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which enabled debug logging and other useful diagnostics. Include a link to a [gist][] containing all of the log files listed by :YcmToggleLogs.

OS version, distribution, etc.

Include system information here.

Output of build/install commands

Include link to a [gist][] containing the invocation and entire output of install.py if reporting an installation issue.

feng-jianwei avatar Aug 01 '22 14:08 feng-jianwei

image

feng-jianwei avatar Aug 01 '22 14:08 feng-jianwei

So you are editing the ycmd source code, and you decide not to load the ycmd extra conf file, but you do load your own extra configuration file from your home directory.

what are you trying to achieve by that?

Unfortunately your steps to reproduce are not complete. Given this is the ycmd codebase it should be trivial for me to reproduce the issue, but I can't given your steps. Can you break down the exact sequence of commands you ran from, and reproduce using the ycm minimal vimrc like the template requests?

puremourning avatar Aug 01 '22 14:08 puremourning

So you are editing the ycmd source code, and you decide not to load the ycmd extra conf file, but you do load your own extra configuration file from your home directory.

what are you trying to achieve by that?

Unfortunately your steps to reproduce are not complete. Given this is the ycmd codebase it should be trivial for me to reproduce the issue, but I can't given your steps. Can you break down the exact sequence of commands you ran from, and reproduce using the ycm minimal vimrc like the template requests?

Thanks for your suggestions

use the ycm minimal vimrc

image

generate compile_commads.json

image-20220801231344457

image-20220801232932721

it alse happend but seems different

image-20220801233105063

image-20220801233133197

No extra configuration file found

image-20220801233611325

What "wrong version" means

image-20220801233843032

feng-jianwei avatar Aug 01 '22 15:08 feng-jianwei

image-20220801233843032

So you are editing the ycmd source code, and you decide not to load the ycmd extra conf file, but you do load your own extra configuration file from your home directory.

what are you trying to achieve by that?

Unfortunately your steps to reproduce are not complete. Given this is the ycmd codebase it should be trivial for me to reproduce the issue, but I can't given your steps. Can you break down the exact sequence of commands you ran from, and reproduce using the ycm minimal vimrc like the template requests?

it used /Users/fjw/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd with ycm_minimal_vimrc

feng-jianwei avatar Aug 01 '22 15:08 feng-jianwei

So you are editing the ycmd source code, and you decide not to load the ycmd extra conf file, but you do load your own extra configuration file from your home directory.

what are you trying to achieve by that?

Unfortunately your steps to reproduce are not complete. Given this is the ycmd codebase it should be trivial for me to reproduce the issue, but I can't given your steps. Can you break down the exact sequence of commands you ran from, and reproduce using the ycm minimal vimrc like the template requests?

I am just using the YCM source code as an example, in fact, I have encountered this problem in other projects

feng-jianwei avatar Aug 01 '22 15:08 feng-jianwei

please can you provide a minimal reproducible test case if you think this is a bug. YOu're not bulding the YCM source code correctly (you should use ./build.py --build-dir build and it should just work). But ycmd is not a minimal project.

use the ycm minimal vimrc

you should run vim -Nu /path/to/minimal_vimrc , like CONTRIBUTING.md says.

puremourning avatar Aug 01 '22 16:08 puremourning

no answer, closing

puremourning avatar Aug 16 '22 20:08 puremourning