From 12db7ad3642ecec23807ad1d78b6794e7e2e581d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 6 Oct 2016 19:12:21 +0200 Subject: [PATCH] Add JediClearCache command This can be used to work around issues like https://github.com/davidhalter/jedi/issues/784. --- autoload/jedi.vim | 7 +++++++ plugin/jedi.vim | 1 + 2 files changed, 8 insertions(+) diff --git a/autoload/jedi.vim b/autoload/jedi.vim index acfff0e..2f839f5 100644 --- a/autoload/jedi.vim +++ b/autoload/jedi.vim @@ -266,6 +266,13 @@ function! jedi#py_import_completions(argl, cmdl, pos) PythonJedi jedi_vim.py_import_completions() endfun +function! jedi#clear_cache(bang) + PythonJedi jedi_vim.jedi.cache.clear_time_caches(True) + if a:bang + PythonJedi jedi_vim.jedi.parser.utils.ParserPickling.clear_cache() + endif +endfunction + " ------------------------------------------------------------------------ " show_documentation diff --git a/plugin/jedi.vim b/plugin/jedi.vim index b6d8c80..1dae363 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -31,5 +31,6 @@ endif command! -nargs=1 -complete=custom,jedi#py_import_completions Pyimport :call jedi#py_import() command! -nargs=0 JediDebugInfo call jedi#debug_info() +command! -nargs=0 -bang JediClearCache call jedi#clear_cache(0) " vim: set et ts=4: