Fix invalidating cache with jedi#show_call_signatures (#968)

This commit is contained in:
Daniel Hahler
2019-12-08 17:26:24 +01:00
committed by Dave Halter
parent ac6b2f1e3e
commit c80a08d983
2 changed files with 26 additions and 5 deletions

View File

@@ -44,6 +44,26 @@ describe 'signatures'
Expect getline(1) == '?!?jedi=0, ?!? (*_*f: Callable*_*) ?!?jedi?!?'
end
it 'highlights correct argument'
if !has('python3')
SKIP 'py2: no signatures with print()'
endif
noautocmd normal o
doautocmd CursorHoldI
noautocmd normal iprint(42, sep="X", )
" Move to "=" - hightlights "sep=...".
noautocmd normal 5h
doautocmd CursorHoldI
Expect getline(1) =~# '\V\^?!?jedi=0, ?!? (*values: object, *_*sep: Text=...*_*'
" Move left to "=" - hightlights first argument ("values").
" NOTE: it is arguable that maybe "sep=..." should be highlighted
" still, but this tests for the cache to be "busted", and that
" fresh results are retrieved from Jedi.
noautocmd normal h
doautocmd CursorHoldI
Expect getline(1) =~# '\V\^?!?jedi=0, ?!? (*_**values: object*_*, sep: Text=...,'
end
it 'no signature'
exe 'normal ostr '
Python jedi_vim.show_call_signatures()