Closed drozdowsky closed 5 years ago
Unfortunately usages has been bad for quite a long time :( #1059 is IMO still the way to go. I feel like it would solve this.
I'm closing, because usages over multiple files is just way too slow without some form of database index.
At the same time I still feel like #1059 is the issue that will eventually solve all your issues.
Sorry!
Issue
Let's consider following example (Python 2.7 with django) models.py
other_file.py
Let's say I I run 'show usages' on definition of Example class. (this line: class Example(models.Model)), the jedi-vim/jedi returns only the same line, there is no other_file.py usage shown. For me it looks like that "show usages" functionality only works when there is direct import and only then jedi can find other usages (it works from other_file.py just fine). This is a issue because it makes this functionality useless imo, it is more useful to run "grep -r" on whole project.
Output of “:verbose JediDebugInfo”
Jedi-vim debug information
jedi-vim version
Global Python
Using Python version 3 to access Jedi.
3.6.7 (default, Oct 22 2018, 11:32:17), [GCC 8.2.0]
/usr/lib/python3.6/site.py
Jedi
/home/self/.vim/bundle/jedi-vim/pythonx/jedi/jedi/__init__.py
Jedi environment: <Environment: 2.7.14 in /home/self/virtualenvs/rp>
/home/self/virtualenvs/rp/lib/python2.7
/home/self/virtualenvs/rp/lib/python2.7/plat-x86_64-linux-gnu
/home/self/virtualenvs/rp/lib/python2.7/lib-tk
/home/self/virtualenvs/rp/lib/python2.7/lib-old
/home/self/virtualenvs/rp/lib/python2.7/lib-dynload
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/home/self/virtualenvs/rp/local/lib/python2.7/site-packages
/home/self/virtualenvs/rp/local/lib/python2.7/site-packages/easyaccept-0.4.1-py2.7.egg
/home/self/virtualenvs/rp/local/lib/python2.7/site-packages/suds_requests-0.3-py2.7.egg
/home/self/virtualenvs/rp/local/lib/python2.7/site-packages/rep_sharenet-1.0.4-py2.7.egg
/home/self/virtualenvs/rp/local/lib/python2.7/site-packages/rep_api-0.2.2-py2.7.egg
/home/self/virtualenvs/rp/local/lib/python2.7/site-packages/requests-2.19.1-py2.7.egg
/home/self/virtualenvs/rp/local/lib/python2.7/site-packages/dbgp-1.1-py2.7.egg
/home/self/virtualenvs/rp/lib/python2.7/site-packages
/home/self/virtualenvs/rp/lib/python2.7/site-packages/easyaccept-0.4.1-py2.7.egg
/home/self/virtualenvs/rp/lib/python2.7/site-packages/suds_requests-0.3-py2.7.egg
/home/self/virtualenvs/rp/lib/python2.7/site-packages/rep_sharenet-1.0.4-py2.7.egg
/home/self/virtualenvs/rp/lib/python2.7/site-packages/rep_api-0.2.2-py2.7.egg
/home/self/virtualenvs/rp/lib/python2.7/site-packages/requests-2.19.1-py2.7.egg
/home/self/virtualenvs/rp/lib/python2.7/site-packages/dbgp-1.1-py2.7.egg
Known environments
<Environment: 2.7.14 in /home/self/virtualenvs/rp> (/home/self/virtualenvs/rp/bin/python)
<Environment: 3.6.7 in /usr> (/usr/bin/python3.6)
<Environment: 3.5.3 in /usr> (/usr/bin/python3.5)
<Environment: 2.7.14 in /home/self/virtualenvs/rp> (/home/self/virtualenvs/rp/bin/python2.7)
Settings
:version
:messages
:scriptnames
``` 1: /usr/share/vim/vimrc 2: /usr/share/vim/vim80/debian.vim 3: /usr/share/vim/vim80/syntax/syntax.vim 4: /usr/share/vim/vim80/syntax/synload.vim 5: /usr/share/vim/vim80/syntax/syncolor.vim 6: /usr/share/vim/vim80/filetype.vim 7: ~/.vimrc 8: /usr/share/vim/vim80/ftoff.vim 9: ~/.vim/bundle/Vundle.vim/autoload/vundle.vim 10: ~/.vim/bundle/Vundle.vim/autoload/vundle/config.vim 11: /usr/share/vim/vim80/ftplugin.vim 12: /usr/share/vim/vim80/indent.vim 13: /usr/share/vim/vim80/syntax/nosyntax.vim 14: ~/.vim/colors/molokai.vim 15: ~/.vim/plugin/swapsucks.vim 16: ~/.vim/bundle/SimpylFold/plugin/SimpylFold.vim 17: ~/.vim/bundle/jedi-vim/plugin/jedi.vim 18: ~/.vim/bundle/ale/plugin/ale.vim 19: ~/.vim/bundle/ale/autoload/ale/events.vim 20: ~/.vim/bundle/nerdtree/plugin/NERD_tree.vim 21: ~/.vim/bundle/nerdtree/autoload/nerdtree.vim 22: ~/.vim/bundle/nerdtree/lib/nerdtree/path.vim 23: ~/.vim/bundle/nerdtree/lib/nerdtree/menu_controller.vim 24: ~/.vim/bundle/nerdtree/lib/nerdtree/menu_item.vim 25: ~/.vim/bundle/nerdtree/lib/nerdtree/key_map.vim 26: ~/.vim/bundle/nerdtree/lib/nerdtree/bookmark.vim 27: ~/.vim/bundle/nerdtree/lib/nerdtree/tree_file_node.vim 28: ~/.vim/bundle/nerdtree/lib/nerdtree/tree_dir_node.vim 29: ~/.vim/bundle/nerdtree/lib/nerdtree/opener.vim 30: ~/.vim/bundle/nerdtree/lib/nerdtree/creator.vim 31: ~/.vim/bundle/nerdtree/lib/nerdtree/flag_set.vim 32: ~/.vim/bundle/nerdtree/lib/nerdtree/nerdtree.vim 33: ~/.vim/bundle/nerdtree/lib/nerdtree/ui.vim 34: ~/.vim/bundle/nerdtree/lib/nerdtree/event.vim 35: ~/.vim/bundle/nerdtree/lib/nerdtree/notifier.vim 36: ~/.vim/bundle/nerdtree/autoload/nerdtree/ui_glue.vim 37: ~/.vim/bundle/nerdtree/nerdtree_plugin/exec_menuitem.vim 38: ~/.vim/bundle/nerdtree/nerdtree_plugin/fs_menu.vim 39: ~/.vim/bundle/ctrlp.vim/plugin/ctrlp.vim 40: ~/.vim/bundle/ctrlp.vim/autoload/ctrlp/mrufiles.vim 41: ~/.vim/bundle/vim-fugitive/plugin/fugitive.vim 42: ~/.vim/bundle/powerline/powerline/bindings/vim/plugin/powerline.vim 43: ~/.vim/bundle/vim-isort/plugin/python_vimisort.vim 44: ~/.vim/bundle/colorizer/plugin/colorizer.vim 45: /usr/share/vim/vim80/plugin/getscriptPlugin.vim 46: /usr/share/vim/vim80/plugin/gzip.vim 47: /usr/share/vim/vim80/plugin/logiPat.vim 48: /usr/share/vim/vim80/plugin/manpager.vim 49: /usr/share/vim/vim80/plugin/matchparen.vim 50: /usr/share/vim/vim80/plugin/netrwPlugin.vim 51: /usr/share/vim/vim80/plugin/rrhelper.vim 52: /usr/share/vim/vim80/plugin/spellfile.vim 53: /usr/share/vim/vim80/plugin/tarPlugin.vim 54: /usr/share/vim/vim80/plugin/tohtml.vim 55: /usr/share/vim/vim80/plugin/vimballPlugin.vim 56: /usr/share/vim/vim80/plugin/zipPlugin.vim 57: ~/.vim/bundle/ale/autoload/ale.vim 58: /usr/share/vim/vim80/scripts.vim 59: ~/.vim/bundle/nerdtree/syntax/nerdtree.vim 60: ~/.vim/bundle/ctrlp.vim/autoload/ctrlp/utils.vim 61: ~/.vim/bundle/SimpylFold/ftplugin/python/SimpylFold.vim 62: ~/.vim/bundle/SimpylFold/autoload/SimpylFold.vim 63: ~/.vim/bundle/jedi-vim/ftplugin/python/jedi.vim 64: ~/.vim/bundle/jedi-vim/autoload/jedi.vim 65: /usr/share/vim/vim80/ftplugin/python.vim 66: ~/.vim/bundle/jedi-vim/after/ftplugin/python/jedi.vim 67: ~/.vim/bundle/indentpython.vim/indent/python.vim 68: /usr/share/vim/vim80/indent/python.vim 69: ~/.vim/syntax/python.vim 70: /usr/share/vim/vim80/syntax/python.vim 71: ~/.vim/bundle/jedi-vim/after/syntax/python.vim 72: ~/.vim/bundle/ale/autoload/ale/util.vim 73: ~/.vim/bundle/ale/autoload/ale/linter.vim 74: ~/.vim/bundle/ale/ale_linters/python/flake8.vim 75: ~/.vim/bundle/ale/ale_linters/python/mypy.vim 76: ~/.vim/bundle/ale/ale_linters/python/prospector.vim 77: ~/.vim/bundle/ale/ale_linters/python/pycodestyle.vim 78: ~/.vim/bundle/ale/ale_linters/python/pyflakes.vim 79: ~/.vim/bundle/ale/ale_linters/python/pylint.vim 80: ~/.vim/bundle/ale/ale_linters/python/pyls.vim 81: ~/.vim/bundle/ale/ale_linters/python/pyre.vim 82: ~/.vim/bundle/ale/ale_linters/python/vulture.vim 83: ~/.vim/bundle/ale/autoload/ale/engine.vim 84: ~/.vim/bundle/ale/autoload/ale/python.vim 85: ~/.vim/bundle/ale/autoload/ale/path.vim 86: ~/.vim/bundle/ale/autoload/ale/history.vim 87: ~/.vim/bundle/ale/autoload/ale/semver.vim 88: ~/.vim/bundle/ale/autoload/ale/command.vim 89: ~/.vim/bundle/ale/autoload/ale/job.vim 90: ~/.vim/bundle/ale/autoload/ale/cursor.vim 91: ~/.vim/bundle/ale/autoload/ale/sign.vim 92: ~/.vim/bundle/ale/autoload/ale/list.vim 93: ~/.vim/bundle/ale/autoload/ale/highlight.vim 94: ~/.vim/bundle/ale/autoload/ale/toggle.vim 95: /usr/share/vim/vim80/ftplugin/qf.vim 96: /usr/share/vim/vim80/syntax/qf.vim ```