ycm-core / YouCompleteMe

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

Does not auto complete identifiers that are not in the current file without scope in c++ #4149

Closed otomn closed 1 year ago

otomn commented 1 year ago

Issue Prelude

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

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

Diagnostic data

Output of vim --version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Aug 28 2022 16:44:20)
macOS version - x86_64
Included patches: 1-300
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+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    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: clang -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lm -lncurses -liconv -lintl -framework AppKit -L/usr/local/opt/lua/lib -llua5.4 -mmacosx-version-min=12.0 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level/CORE -lperl -L/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/config-3.10-darwin -lpython3.10 -framework CoreFoundation -lruby.3.1 -L/usr/local/Cellar/ruby/3.1.2_1/lib 

Output of YcmDebugInfo

Printing YouCompleteMe debug information...                       
-- Resolve completions: Never
-- Client logfile: /var/folders/4_/v5r8kd81215dtnxlv9vsqpkw0000gn/T/ycm_nyjyhz69.log

-- Server Python interpreter: /usr/local/opt/python@3.10/bin/python3.10
-- Server Python version: 3.10.6
-- Server has Clang support compiled in: True
-- Clang version: clang version 14.0.0 (https://github.com/tru/llvm-release-build fc
075d7c96fe7c992dde351695a5d25fe084794a)
-- No extra configuration file found
-- C-family completer debug information:
--   Clangd running
--   Clangd process ID: 49878
--   Clangd executable: ['/Users/toby/.vim/bundle/YouCompleteMe/third_party/ycmd/thi
rd_party/clangd/output/bin/clangd', '-header-insertion-decorators=0', '-resource-dir
=/Users/toby/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/clang/lib/clang/
14.0.0', '-limit-results=500']
--   Clangd logfiles:
--     /var/folders/4_/v5r8kd81215dtnxlv9vsqpkw0000gn/T/clangd_stderrr3pxjwdv.log
--   Clangd Server State: Initialized
--   Clangd Project Directory: /Users/toby/test
--   Clangd Settings: {}
--   Clangd Compilation Command: False
-- Server running at: http://127.0.0.1:57706
-- Server process ID: 49876
-- Server logfiles:
--   /var/folders/4_/v5r8kd81215dtnxlv9vsqpkw0000gn/T/ycmd_57706_stdout_ifq5ya6v.log

--   /var/folders/4_/v5r8kd81215dtnxlv9vsqpkw0000gn/T/ycmd_57706_stderr_z941uy81.log

-- Semantic highlighting supported: True
-- Virtual text supported: True
-- Popup windows supported: True
puremourning commented 1 year ago

I have read and understood YCM's README, especially the Frequently Asked Questions section.

Well, this is explained in the very first entry in the FAQ, so I'm fairly sure you didn't do that.