ycm-core / YouCompleteMe

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

[question] Is it possible to modify the format of virtual-text? #4214

Open marslo opened 5 months ago

marslo commented 5 months 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

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

Diagnostic data

Output of vim --version

$ vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan  8 2024 16:50:47)
macOS version - x86_64
Included patches: 1-16
Compiled by marslo <marslo.jiao@gmail.com>
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/dyn       +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby/dyn          +wildignore
+cursorbind        +lua/dyn           +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      +sodium            -X11
+digraphs          +mouse             +sound             -xattr
-dnd               -mouseshape        +spell             -xfontset
-ebcdic            +mouse_dec         +startuptime       -xim
+emacs_tags        -mouse_gpm         +statusline        -xpm
+eval              -mouse_jsbterm     -sun_workshop      -xsmp
+ex_extra          +mouse_netterm     +syntax            -xterm_clipboard
+extra_search      +mouse_sgr         +tag_binary        -xterm_save
-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/vim/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/local/include -I/usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home/include -I/usr/local/opt/openldap/include -I/usr/local/opt/curl/include -I/usr/local/opt/binutils/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/opt/node@21/include -I/usr/local/opt/tcl-tk/include -I/usr/local/Cellar/icu4c@71.1/71.1/include -I/usr/local/opt/llvm/include -I/usr/local/opt/libiconv/include -I/usr/local/opt/ncurses/include -DMACOS_X -DMACOS_X_DARWIN -I/usr/local/include -I/usr/local/opt/tcl-tk/include -I/usr/local/Cellar/libsodium/1.0.19/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openldap/lib -L/usr/local/opt/curl/lib -L/usr/local/opt/binutils/lib -L/usr/local/opt/python@3.12/lib -L/usr/local/opt/tcl-tk/lib -L/usr/local/opt/sqlite/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/node@21/lib -L/usr/local/Cellar/icu4c@71.1/71.1/lib -L/usr/local/opt/ncurses/lib -L/usr/local/opt/libiconv/lib -L/usr/local/opt/llvm/lib -L/usr/local/opt/llvm/lib/c++ -Wl,-rpath,/usr/local/opt/llvm/lib/c++ -o vim -lm -lncurses -L/usr/local/Cellar/libsodium/1.0.19/lib -lsodium -liconv -lintl -framework AppKit

Output of git rev-parse HEAD in YouCompleteMe installation directory

$ git -C ~/.vim/plugged/YouCompleteMe/ rev-parse HEAD
79c850b4a674a4f461a670f4515ab953bb89d632

OS version, distribution, etc.

$ sw_vers
ProductName:        macOS
ProductVersion:     14.2.1
BuildVersion:       23C71
puremourning commented 5 months ago

No, there is no way to customise this currently. ycmd always formats it as msg [code].

marslo commented 5 months ago

Will you considering to enable the format customization feature like ale:

let g:ale_echo_msg_format    = '[%linter%] %code%: %s [%severity%] '
let g:ale_virtualtext_prefix = '%comment% %severity% [%code%]: '