ycm-core / YouCompleteMe

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

GetDoc command doesn't show line wrappings properly #3223

Closed ApolloBian closed 5 years ago

ApolloBian commented 5 years 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 - Vi IMproved 8.1 (2018 May 17, compiled Nov 11 2018 02:45:54)
Included patches: 1-5
Compiled by bian_tianling@sjtu.edu.cn
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    -tcl
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
+balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
+browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          +toolbar
+cindent           +insert_expand     +path_extra        +user_commands
+clientserver      +job               -perl              +vertsplit
+clipboard         +jumplist          +persistent_undo   +virtualedit
+cmdline_compl     +keymap            +postscript        +visual
+cmdline_hist      +lambda            +printer           +visualextra
+cmdline_info      +langmap           +profile           +viminfo
+comments          +libcall           +python            +vreplace
+conceal           +linebreak         -python3           +wildignore
+cryptv            +lispindent        +quickfix          +wildmenu
+cscope            +listcmds          +reltime           +windows
+cursorbind        +localmap          +rightleft         +writebackup
+cursorshape       -lua               +ruby              +X11
+dialog_con_gui    +menu              +scrollbind        -xfontset
+diff              +mksession         +signs             +xim
+digraphs          +modify_fname      +smartindent       +xpm
+dnd               +mouse             +startuptime       +xsmp_interact
-ebcdic            +mouseshape        +statusline        +xterm_clipboard
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
+eval              -mouse_gpm         +syntax
+ex_extra          -mouse_jsbterm     +tag_binary
+extra_search      +mouse_netterm     +tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/slhome-01/tianling/.local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2   -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -fstack-protector -rdynamic -Wl,-export-dynamic -L/home/linuxbrew/.linuxbrew/opt/libyaml/lib  -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/libyaml/lib -L/home/linuxbrew/.linuxbrew/opt/openssl/lib  -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/openssl/lib -L/home/linuxbrew/.linuxbrew/opt/readline/lib  -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/readline/lib  -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl   -lacl -lattr -ldl    -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions   -Wl,-rpath,/home/linuxbrew/.linuxbrew/Cellar/ruby/2.4.3_1/lib -L/home/linuxbrew/.linuxbrew/Cellar/ruby/2.4.3_1/lib -lruby -lpthread -ldl -lcrypt -lm

Output of YcmDebugInfo

Printing YouCompleteMe debug information...
-- Client logfile: /tmp/ycm_ZKj4bV.log
-- Server Python interpreter: /usr/bin/python
-- Server Python version: 2.7.12
-- Server has Clang support compiled in: True
-- Clang version: clang version 7.0.0 (tags/RELEASE_700/final)
-- Extra configuration file found and loaded
-- Extra configuration path: /slhome-01/tianling/.ycm_global_extra_conf.py
-- Python completer debug information:
--   Python interpreter: /slhome-01/tianling/python-virtualenv/python3.5-ycm-completion/bin/python
--   Python path: [u'/usr/lib/python35.zip', u'/usr/lib/python3.5', u'/usr/lib/python3.5/plat-x86_64-linux-gnu', u'/usr/lib/python3.5/lib-dynload', u'/slhome-
01/tianling/python-virtualenv/python3.5-ycm-completion/lib/python3.5/site-packages']
--   Python version: 3.5.2
--   Jedi version: 0.13.1
--   Parso version: 0.3.1
-- Server running at: http://127.0.0.1:44787
-- Server process ID: 148260
-- Server logfiles:
--   /tmp/ycmd_44787_stdout_ZNmOgm.log
--   /tmp/ycmd_44787_stderr_SP4Tcr.log

Contents of YCM, ycmd and completion engine logfiles

(not relevent?)

Add let g:ycm_log_level = 'debug' to vimrc, restart Vim, reproduce the issue, and include link here to a [gist][] containing the entire logfiles for ycm, ycmd and any completer logfiles listed by :YcmToggleLogs.

OS version, distribution, etc.

Ubuntu 16.04LTS

ApolloBian commented 5 years ago

ycm version: faa019aa532475c5028527ffbfe1e910119d663c (master)

micbou commented 5 years ago

Thanks for the report. This is what Jedi, the completion engine used for Python, is returning to us. I've opened a PR on the Jedi repository that improves the signature formatting in that case: https://github.com/davidhalter/jedi/pull/1252.

ApolloBian commented 5 years ago

@micbou cool! Thanks for the hard work.

micbou commented 5 years ago

Fixed by PR #3312.