Open sassanh opened 7 years ago
The snippet@0
is a workaround for snippet expansion, it is appended to the preview window, it does not control the display of the docstring Sends a POST request.
if it exists.
It seems this is a behavior of the jedi library.
Here's my test on jedi-vim's omnifunc with set completeopt=menu,menuone,noinsert,noselect,preview
:
Test 1:
import requests
requests.<c-x><c-o>
Then select the post
item, the preview window does not appear
Test 2:
import requests
requests.pos<c-x><c-o>
Then select the post
item, the preview window appears
// cc @davidhalter
minimal vimrc:
set nocompatible
syntax on
filetype plugin indent on
set encoding=utf-8 fileencodings=ucs-bom,utf-8,gbk,gb18030,latin1 termencoding=utf-8
call plug#begin(expand('<sfile>:h') . '/plugged/')
Plug 'davidhalter/jedi-vim'
call plug#end()
set completeopt=menu,menuone,noinsert,noselect,preview
gif:
Well I think that's another issue or maybe I didn't get the relation. To clarify: my problem is when I have ultisnips disabled it shows doc string but when ultisnips is enabled instead of docstring it shows snippet@0
. I want to somehow have docstring even when ultisnips is enabled.
I confirm even when ultisnips is disabled it doesn't show docstring when I type request.p
and then select post
. But with ultisnips disabled it does show docstring with request.pos
and then selecting post
and when ultisnips is enabled it shows snippet@0
even when I type request.pos
and then select post
.
Well I think that's another issue or maybe I didn't get the relation
When the docstring returned by jedi is empty, but there's a snippet for the item, it only shows the snippet.
I want to somehow have docstring even when ultisnips is enabled.
Ultisnips should not affect the display of docstring if it's not empty. And I cannot reproduce the issue you described.
and when ultisnips is enabled it shows snippet@0 even when I type request.pos and then select post.
NCM caches the result when you typed .
, in this case, you need to force refresh with the <Plug>(cm_force_refresh)
key when the cursor is at pos|
.
This gif shows my point.
Yeah seems like it's related to cache. Is it possible to disable cache altogether?
Is it possible to disable cache altogether?
Not possible with current version. The cache control is hard-coded by ncm's jedi source.
OK, thanks for info.
I decided to disable the caching of jedi source.
You could test this PR #128
This is how it looks like. I believe it should still be considered as an upstream bug.
Unfortunately it doesn't work for me: https://asciinema.org/a/5XU59J75bDiC3pFgpwj6tu17S
It seems the no-cache version slows things down.
And unfortunately this will make fuzzy matching impossible, since jedi doesn't have builtin fuzzy matching: https://github.com/davidhalter/jedi/issues/827
Maybe I should revert the change.
Yeah seems like we should wait for jedi.
I've pushed another update. Please test it in case the no-cache is not the cause.
It's working for me now. Thanks.
Currently if in a python buffer I type:
and select "post" from autocompletion list popup window shows:
If I disable
ultisnips
and restart vim I getIs it possible to achieve this without disabling ultisnips? some way to prioritize python help over ultisnips for popup window.