davidhalter / jedi-vim

Using the jedi autocompletion library for VIM.
MIT License
5.29k stars 370 forks source link

Function Signature Displayed Weirdly #1009

Closed alichtman closed 3 years ago

alichtman commented 4 years ago

Issue

Sometimes the function signature is displayed like this:

image

And other times, it's displayed like this:

image

The second version eats into the line above the completion. Here's the plain source code for reference:

image

I'm wondering how either:

  1. Have the "popup window" of the call signature in the first version displayed for the whole time during completion, and not show the weird mangled version behind it
  2. Have a cleaner second version showed (that doesn't mangle the line above it)

Here's a version that can be reproduced with a minimal vimrc:

image
call plug#begin('~/.local/share/nvim/plugged')
Plug 'davidhalter/jedi-vim'
call plug#end()

set hidden                      " Enable buffers to exist in the background
syntax on

let g:jedi#popup_on_dot = 0

let g:jedi#smart_auto_mappings = 1

" Shows docs for highlighted word
let g:jedi#documentation_command = "H"

let g:python3_host_prog = '/usr/local/bin/python3'
let g:python_host_prog = '/usr/local/bin/python2'

I will note that I can't get the full "doc" window to pop up with this minimal vimrc, which makes me think that's a coc-python feature and not a jedi feature, but I don't have a ton of time to dig into this at the moment.

Do you know how to make this all play nicely together? For reference, here's my full vimrc: https://github.com/alichtman/dotfiles/blob/master/.config/nvim/init.vim

Steps to reproduce

Output of “:verbose JediDebugInfo”

Jedi-vim debug information

jedi-vim version
Global Python

Using Python version 3 to access Jedi.

Jedi
Jedi environment: <SameEnvironment: 3.8.1 in /usr/local/var/pyenv/versions/3.8.1/Python.framework/Versions/3.8>
Known environments
Settings
g:jedi#documentation_command = 'H' (default: 'K')
g:jedi#popup_on_dot = 0 (default: 1)

  omnifunc=jedi#completions
    Last set from ~/.local/share/nvim/view/~=+Desktop=+LING301=+grades.py= line 114
  completeopt=menuone,longest,preview
    Last set from ~/.local/share/nvim/plugged/jedi-vim/plugin/jedi.vim line 36

:version


NVIM v0.4.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20191107-13403-1or2rj3/neovim-0.4.3/build/config -I/tmp/neovim-20191107-13403-1or2rj3/neovim-0.4.3/src -I/usr/local/include -I/tmp/neovim-20191107-13403-1or2rj3/neovim-0.4.3/deps-build/include -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/tmp/neovim-20191107-13403-1or2rj3/neovim-0.4.3/build/src/nvim/auto -I/tmp/neovim-20191107-13403-1or2rj3/neovim-0.4.3/build/include
Compiled by brew@Mojave.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.3/share/nvim"

Run :checkhealth for more info

:messages

:scriptnames

  1: ~/.config/nvim/init.vim
  2: ~/.local/share/nvim/site/autoload/plug.vim
  3: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/filetype.vim
  4: ~/.local/share/nvim/plugged/vim-polyglot/ftdetect/polyglot.vim
  5: ~/.local/share/nvim/plugged/vim-pandoc/ftdetect/pandoc.vim
  6: ~/.local/share/nvim/plugged/vim-fugitive/ftdetect/fugitive.vim
  7: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/ftplugin.vim
  8: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/indent.vim
  9: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/syntax/syntax.vim
 10: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/syntax/synload.vim
 11: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/syntax/syncolor.vim
 12: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/macros/matchit.vim
 13: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/syntax/nosyntax.vim
 14: ~/.local/share/nvim/plugged/ale/plugin/ale.vim
 15: ~/.local/share/nvim/plugged/ale/autoload/ale/events.vim
 16: ~/.local/share/nvim/plugged/coc.nvim/plugin/coc.vim
 17: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/rpc.vim
 18: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/util.vim
 19: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/client.vim
 20: ~/.local/share/nvim/plugged/jedi-vim/plugin/jedi.vim
 21: ~/.local/share/nvim/plugged/vim-run-interactive/plugin/run-interactive.vim
 22: ~/.local/share/nvim/plugged/nerdtree/plugin/NERD_tree.vim
 23: ~/.local/share/nvim/plugged/nerdtree/autoload/nerdtree.vim
 24: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/path.vim
 25: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/menu_controller.vim
 26: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/menu_item.vim
 27: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/key_map.vim
 28: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/bookmark.vim
 29: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/tree_file_node.vim
 30: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/tree_dir_node.vim
 31: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/opener.vim
 32: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/creator.vim
 33: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/flag_set.vim
 34: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/nerdtree.vim
 35: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/ui.vim
 36: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/event.vim
 37: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/notifier.vim
 38: ~/.local/share/nvim/plugged/nerdtree/autoload/nerdtree/ui_glue.vim
 39: ~/.local/share/nvim/plugged/nerdtree/nerdtree_plugin/exec_menuitem.vim
 40: ~/.local/share/nvim/plugged/nerdtree/nerdtree_plugin/fs_menu.vim
 41: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/autoload/provider/clipboard.vim
 42: ~/.local/share/nvim/plugged/nerdtree/nerdtree_plugin/vcs.vim
 43: ~/.local/share/nvim/plugged/vim-devicons/nerdtree_plugin/webdevicons.vim
 44: /usr/local/Cellar/fzf/0.21.1/plugin/fzf.vim
 45: ~/.local/share/nvim/plugged/fzf.vim/plugin/fzf.vim
 46: ~/.local/share/nvim/plugged/vim-litecorrect/plugin/litecorrect.vim
 47: ~/.local/share/nvim/plugged/vim-dict/plugin/dict.vim
 48: ~/.local/share/nvim/plugged/vim-zenroom2/plugin/zenroom2.vim
 49: ~/.local/share/nvim/plugged/vim-thematic/plugin/thematic/gui.vim
 50: ~/.local/share/nvim/plugged/vim-thematic/plugin/thematic.vim
 51: ~/.local/share/nvim/plugged/vim-devicons/plugin/webdevicons.vim
 52: ~/.local/share/nvim/plugged/vim-startify/plugin/startify.vim
 53: ~/.local/share/nvim/plugged/goyo.vim/plugin/goyo.vim
 54: ~/.local/share/nvim/plugged/limelight.vim/plugin/limelight.vim
 55: ~/.local/share/nvim/plugged/vista.vim/plugin/vista.vim
 56: ~/.local/share/nvim/plugged/vim-peekaboo/plugin/peekaboo.vim
 57: ~/.local/share/nvim/plugged/tabular/plugin/Tabular.vim
 58: ~/.local/share/nvim/plugged/bullets.vim/plugin/bullets.vim
 59: ~/.local/share/nvim/plugged/vim-pandoc/plugin/pandoc.vim
 60: ~/.local/share/nvim/plugged/vim-pandoc-syntax/plugin/pandoc-syntax-check.vim
 61: ~/.local/share/nvim/plugged/md-img-paste.vim/plugin/mdip.vim
 62: ~/.local/share/nvim/plugged/delimitMate/plugin/delimitMate.vim
 63: ~/.local/share/nvim/plugged/delimitMate/autoload/delimitMate.vim
 64: ~/.local/share/nvim/plugged/vim-surround/plugin/surround.vim
 65: ~/.local/share/nvim/plugged/vim-rhubarb/plugin/rhubarb.vim
 66: ~/.local/share/nvim/plugged/vim-fugitive/plugin/fugitive.vim
 67: ~/.local/share/nvim/plugged/gist-vim/plugin/gist.vim
 68: ~/.local/share/nvim/plugged/vim-smoothie/plugin/smoothie.vim
 69: ~/.local/share/nvim/plugged/vim-airline/plugin/airline.vim
 70: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/init.vim
 71: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/parts.vim
 72: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/util.vim
 73: ~/.local/share/nvim/plugged/vim-airline-themes/plugin/airline-themes.vim
 74: ~/.local/share/nvim/plugged/vim-ripgrep/plugin/vim-ripgrep.vim
 75: ~/.local/share/nvim/plugged/vim-easymotion/plugin/EasyMotion.vim
 76: ~/.local/share/nvim/plugged/scratch.vim/plugin/scratch.vim
 77: ~/.local/share/nvim/plugged/nerdcommenter/plugin/NERD_commenter.vim
 78: ~/.local/share/nvim/plugged/vim-wakatime/plugin/wakatime.vim
 79: ~/.local/share/nvim/plugged/suda.vim/plugin/suda.vim
 80: ~/.local/share/nvim/plugged/suda.vim/autoload/suda.vim
 81: ~/.local/share/nvim/plugged/undotree/plugin/undotree.vim
 82: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/gzip.vim
 83: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/health.vim
 84: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/man.vim
 85: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/matchit.vim
 86: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
 87: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/matchparen.vim
 88: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/netrwPlugin.vim
 89: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/rplugin.vim
 90: ~/.local/share/nvim/rplugin.vim
 91: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/shada.vim
 92: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/spellfile.vim
 93: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/tarPlugin.vim
 94: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/tohtml.vim
 95: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/tutor.vim
 96: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/plugin/zipPlugin.vim
 97: ~/.local/share/nvim/plugged/indentLine/after/plugin/indentLine.vim
 98: ~/.local/share/nvim/plugged/tabular/after/plugin/TabularMaps.vim
 99: ~/.local/share/nvim/plugged/tabular/autoload/tabular.vim
100: ~/.local/share/nvim/plugged/vim-polyglot/compiler/python.vim
101: ~/.local/share/nvim/plugged/jedi-vim/ftplugin/python/jedi.vim
102: ~/.local/share/nvim/plugged/jedi-vim/autoload/jedi.vim
103: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/autoload/provider/python3.vim
104: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/autoload/provider/pythonx.vim
105: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/autoload/remote/host.vim
106: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/autoload/provider.vim
107: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/ftplugin/python.vim
108: ~/.local/share/nvim/plugged/jedi-vim/after/ftplugin/python/jedi.vim
109: ~/.local/share/nvim/plugged/vim-polyglot/indent/python.vim
110: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/indent/python.vim
111: ~/.local/share/nvim/plugged/vim-polyglot/syntax/python.vim
112: /usr/local/Cellar/neovim/0.4.3/share/nvim/runtime/syntax/python.vim
113: ~/.local/share/nvim/plugged/jedi-vim/after/syntax/python.vim
114: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions.vim
115: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/quickfix.vim
116: ~/.local/share/nvim/plugged/vim-airline/autoload/airline.vim
117: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/netrw.vim
118: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/term.vim
119: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/section.vim
120: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/highlighter.vim
121: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/undotree.vim
122: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/hunks.vim
123: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/vista.vim
124: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/branch.vim
125: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim
126: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/ale.vim
127: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/coc.vim
128: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim
129: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/po.vim
130: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/wordcount.vim
131: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline.vim
132: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/autoshow.vim
133: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/tabs.vim
134: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim
135: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/keymap.vim
136: ~/.local/share/nvim/plugged/vim-polyglot/autoload/vimtex.vim
137: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/vimtex.vim
138: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/themes/dark.vim
139: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/themes.vim
140: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/builder.vim
141: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/default.vim
142: ~/.local/share/nvim/view/~=+Desktop=+LING301=+grades.py=
143: ~/.local/share/nvim/plugged/ale/autoload/ale.vim
144: ~/.local/share/nvim/plugged/ale/autoload/ale/util.vim
145: ~/.local/share/nvim/plugged/ale/autoload/ale/linter.vim
146: ~/.local/share/nvim/plugged/ale/ale_linters/python/bandit.vim
147: ~/.local/share/nvim/plugged/ale/ale_linters/python/flake8.vim
148: ~/.local/share/nvim/plugged/ale/ale_linters/python/mypy.vim
149: ~/.local/share/nvim/plugged/ale/ale_linters/python/prospector.vim
150: ~/.local/share/nvim/plugged/ale/ale_linters/python/pycodestyle.vim
151: ~/.local/share/nvim/plugged/ale/ale_linters/python/pydocstyle.vim
152: ~/.local/share/nvim/plugged/ale/ale_linters/python/pyflakes.vim
153: ~/.local/share/nvim/plugged/ale/ale_linters/python/pylama.vim
154: ~/.local/share/nvim/plugged/ale/ale_linters/python/pylint.vim
155: ~/.local/share/nvim/plugged/ale/ale_linters/python/pyls.vim
156: ~/.local/share/nvim/plugged/ale/ale_linters/python/pyre.vim
157: ~/.local/share/nvim/plugged/ale/ale_linters/python/vulture.vim
158: ~/.local/share/nvim/plugged/ale/autoload/ale/engine.vim
159: ~/.local/share/nvim/plugged/ale/autoload/ale/command.vim
160: ~/.local/share/nvim/plugged/ale/autoload/ale/python.vim
161: ~/.local/share/nvim/plugged/ale/autoload/ale/path.vim
162: ~/.local/share/nvim/plugged/ale/autoload/ale/history.vim
163: ~/.local/share/nvim/plugged/ale/autoload/ale/semver.vim
164: ~/.local/share/nvim/plugged/ale/autoload/ale/job.vim
165: ~/.local/share/nvim/plugged/vim-peekaboo/autoload/peekaboo.vim
166: ~/.local/share/nvim/plugged/vim-thematic/autoload/thematic.vim
167: ~/.local/share/nvim/plugged/palenight.vim/colors/palenight.vim
168: ~/.local/share/nvim/plugged/palenight.vim/autoload/palenight.vim
169: ~/.local/share/nvim/plugged/palenight.vim/autoload/airline/themes/palenight.vim
170: ~/.local/share/nvim/plugged/vista.vim/autoload/vista.vim
171: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/init.vim
172: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/source.vim
173: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/executive/ctags.vim
174: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/statusline.vim
175: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/util.vim
176: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/autocmd.vim
177: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/types/uctags/python.vim
178: ~/.local/share/nvim/plugged/ale/autoload/ale/cursor.vim
179: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/cursor.vim
180: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/ctrlspace.vim
181: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/tabws.vim
182: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim
183: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/buflist.vim
184: ~/.local/share/nvim/plugged/vim-devicons/autoload/airline/extensions/tabline/formatters/webdevicons.vim
185: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/default.vim
186: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/async.vim
187: ~/.local/share/nvim/plugged/ale/autoload/ale/statusline.vim
188: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/parser/ctags.vim
189: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/renderer.vim
190: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc.vim
191: ~/.local/share/nvim/plugged/ale/autoload/ale/sign.vim
192: ~/.local/share/nvim/plugged/ale/autoload/ale/list.vim
193: ~/.local/share/nvim/plugged/ale/autoload/ale/highlight.vim
194: /private/var/folders/ph/ffxb58fj3gv76s5swk23wmzw0000gn/T/coc.nvim-51870/coc-51870.vim
195: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/list.vim
196: ~/.local/share/nvim/plugged/vim-easymotion/autoload/EasyMotion.vim
197: ~/.local/share/nvim/plugged/vim-easymotion/autoload/EasyMotion/highlight.vim
198: ~/.local/share/nvim/view/list:=+=+=+lists=
199: ~/.local/share/nvim/plugged/vista.vim/autoload/vista/sidebar.vim
200: ~/.local/share/nvim/view/list:=+=+=+extensions=
davidhalter commented 4 years ago

I basically gave up to fix all of these cases, because it's such a big hack.

I'm hoping for floating windows to come to VIM and think that we can find a good solution at that point.

There's still show_calls_signatures = 2 if you're unhappy with the function signature display.

alichtman commented 4 years ago

Have any suggestions for neovim? I run that instead of vim.

Thanks for the quick response btw

davidhalter commented 4 years ago

You could try https://github.com/davidhalter/jedi-vim/pull/652.

alichtman commented 4 years ago

You could try https://github.com/davidhalter/jedi-vim/pull/652.

I’ll give it a shot when I have a minute and let you know how it works.

davidhalter commented 3 years ago

Same issue as #493. We are trying to get rid of changing the buffer for this feature and are trying to use floating windows.