python-lsp / python-lsp-server

Fork of the python-language-server project, maintained by the Spyder IDE team and the community
MIT License
1.9k stars 196 forks source link

`:LspHover` in Vim9 with lsp and python-lsp-server renders ugly formatting #562

Open LuisBL opened 4 months ago

LuisBL commented 4 months ago

Below rendering of :LspHover Vs the one provide by ipython

enter image description here

I don't know if it's my configuration or a lsp problem or python-lsp-server side ?

my version of python-lsp-server

  $ pyenv virtualenv system lsp
  $ pyenv activate lsp
  (lsp) $ pip install python-lsp-server[all] -U
  (lsp) $ pip list | grep -E 'lsp'
  python-lsp-jsonrpc    1.1.2
  python-lsp-server     1.11.0
  (lsp) $

vim 9.0:

  $ vim --version | head -1
  VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 10 2022 08:40:37)
  $

my .vimrc:

  $ tail -14 ~/.vimrc
  call plug#begin('~/.vim/plugged')
    Plug 'yegappan/lsp'
  call plug#end()

  let lspOpts = #{autoHighlightDiags: v:true}
  autocmd User LspSetup call LspOptionsSet(lspOpts)

  let lspServers = [#{ name: 'pylsp',
                   \   filetype: 'python',
                   \   path: 'expand(~/.pyenv/versions/lsp/bin/pylsp'),
                   \   args: ['--verbose', '--log-file', '/tmp/out_lsp.log'],
                   \ }]
  autocmd User LspSetup call LspAddServer(lspServers)
  $