[bug][rust][real time diagnostics] the diagnostic is not real time
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.][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
:YcmToggleLogscommand. - [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. - [ ] If filing a installation failure report, I have included the entire output
of
install.py(orcmake/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: When I start a new workspace with cargo, and coding inside, the diagnostic info is not real time, it only works when a file is open, during the coding, the diagnostic info is not updated automatically, even I ran
:ycmDiagsmanually, the info would not change.
- What did you do?
Include steps to reproduce here.
cargo new <your project name>vim src/main.rs- Enter insert mode and type some nonsense inside the main function or your own function
Include description of a minimal test case, including any actual code required to reproduce the issue. for example: I typed a
pinside a function, but no diagnostic info displayedThen I ran
:ycmDiags, still nothing changedI closed the current file, and opened it again, diagnostic was there
If you made changes to
vimrc_ycm_minimal, pase them here:
<contents of ycm_vimrc_minimal>
- What did you expect to happen?
The diagnostic info should be updated/refreshed automatically, at least, when
:ycmDiagsis ran manually, it should be updated.
Include description of the expected behaviour.
- What actually happened? The diagnostic info only got updated when a file was opened, after that, no matter what changes were made, the diagnostic info wound't change until the file was closed and reopen again.
Include description of the observed behaviour, including actual output, screenshots, etc.
Diagnostic data
Output of vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 24 2021 12:49:30)
macOS version - x86_64
Included patches: 1-2400
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm -tcl
-autoservername +folding +multi_byte +termguicolors
-balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
-browse +gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 +perl +title
-clientserver +job +persistent_undo -toolbar
+clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall -python +visual
+conceal +linebreak +python3 +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape +lua +ruby +wildmenu
+dialog_con +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent -X11
-dnd +mouse -sound -xfontset
-ebcdic -mouseshape +spell -xim
+emacs_tags +mouse_dec +startuptime -xpm
+eval -mouse_gpm +statusline -xsmp
+ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save
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 -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/[email protected]/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=11.1 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.32.1/lib/perl5/5.32.1/darwin-thread-multi-2level/CORE -lperl -L/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib/python3.9/config-3.9-darwin -lpython3.9 -framework CoreFoundation -lruby.3.0 -L/usr/local/Cellar/ruby/3.0.0_1/lib
Output of YcmDebugInfo
Printing YouCompleteMe debug information...
-- Resolve completions: Up front
-- Client logfile: /var/folders/0t/9yws28hx1rg576_2nvtwhxjm0000gn/T/ycm_379p09a3.log
-- Server Python interpreter: /usr/local/opt/[email protected]/bin/python3.9
-- Server Python version: 3.9.1
-- Server has Clang support compiled in: True
-- Clang version: clang version 11.0.0 (https://github.com/llvm/llvm-project.git 176249bd6732a8044d457092ed932768724a6f06)
-- No extra configuration file found
-- Rust completer debug information:
-- Rust Language Server running
-- Rust Language Server process ID: 6850
-- Rust Language Server executable: ['/Users/chengcan.he/.vim/bundle/youcompleteme/third_party/ycmd/third_party/rust-analyzer/bin/rust-analyzer']
-- Rust Language Server logfiles:
-- /var/folders/0t/9yws28hx1rg576_2nvtwhxjm0000gn/T/rust_language_server_stderrml9abgcr.log
-- Rust Language Server Server State: Initialized
-- Rust Language Server Project Directory: /Users/chengcan.he/rust_prog/practice
-- Rust Language Server Settings: {}
-- Rust Language Server Project State: ready
-- Rust Language Server Version: 0d03fe6
-- Rust Language Server Rust Root: /Users/chengcan.he/.vim/bundle/youcompleteme/third_party/ycmd/third_party/rust-analyzer
-- Server running at: http://127.0.0.1:62521
-- Server process ID: 6845
-- Server logfiles:
-- /var/folders/0t/9yws28hx1rg576_2nvtwhxjm0000gn/T/ycmd_62521_stdout_n7zfw261.log
-- /var/folders/0t/9yws28hx1rg576_2nvtwhxjm0000gn/T/ycmd_62521_stderr_uzo8riur.log
Output of YcmDiags
Paste output here
Output of git rev-parse HEAD in YouCompleteMe installation directory
ed423e8a1d2a5842a126d33b824ad3b65f85f3ba
OS version, distribution, etc.
Include system information here. macOs big sur, 11.2.3
https://github.com/rust-analyzer/rust-analyzer/issues/4185
Then I ran
I closed the current file, and opened it again, diagnostic was there
