Closed ddnomad closed 5 years ago
I've just tested pyrope
and it successfully finds documentation for both sys
and hashlib
.
Isn't this a pymode thing/issue?
let g:pymode_doc_key = 'K'
I don't think so, as with the same setup jedi
does find docs for os
module. So it works rather randomly. I can test out other imports as well tot see with what particular modules issue persists.
So this is what I've found out:
import os # ok
import sys # fail
import random # ok
import pprint # ok
import hashlib # fail
import pyproj # ok
import flask # ok
import abc # ok
import cmath # fail
UPDATE: after using default <leader>d
bind for goto_declaration() vim freezed and started to consume 100% of CPU.
I think this is a Jedi bug, downgrade to Jedi 0.9.0 and check again. I think I've seen similar bugs somewhere.
I'm also seeing this. Depending on the directory I'm in, docs for some modules don't work. sys
and re
always work, os
rarely. If the module isn't found, completion for that module won't work either.
OS: debian stable
Downgrading does nothing.
This has been an issue long ago. I'm a bit confused that someone is still seeing this. It has been working for me very well in these cases. Downgrading likely won't help, use Jedi 0.13.3+.
If I'm the only one, maybe there's some problem with my setup. But I get the same in vim, Sublime Text and VS Code, so it isn't vim.
Examples: module os
working in ~/abs/s2t.py
Not working in ~/Dropbox/Progetti/Python/Book/abs/s2t.py
Can you also add the debug info?
Where do I take them from?
Ok
#### Jedi-vim debug information
##### jedi-vim version
- jedi-vim git version: f26b2a8-dirty
- jedi git submodule status: +8d0c4d3cec4973a2722652bf33f093ac3f1f385a pythonx/jedi (v0.13.3-19-g8d0c4d3c)
- parso git submodule status: acccb4f28d6d57f4ad4c882f3408136ee8f50ff5 pythonx/parso (v0.3.4)
##### Global Python
Using Python version 3 to access Jedi.
- global sys.version: `3.5.3 (default, Sep 27 2018, 17:25:39), [GCC 6.3.0 20170516]`
- global site module: `/usr/lib/python3.5/site.py`
##### Jedi
- path: `/home/gianmaria/.vim/plugged/jedi-vim/pythonx/jedi/jedi/__init__.py`
- version: 0.13.3
##### Jedi environment: <SameEnvironment: 3.5.3 in /usr>
- executable: /usr/bin/python3
- sys_path:
- `/usr/lib/python35.zip`
- `/usr/lib/python3.5`
- `/usr/lib/python3.5/plat-x86_64-linux-gnu`
- `/usr/lib/python3.5/lib-dynload`
- `/home/gianmaria/.local/lib/python3.5/site-packages`
- `/usr/local/lib/python3.5/dist-packages`
- `/usr/lib/python3/dist-packages`
##### Known environments
- <Environment: 3.7.2 in /usr> (/usr/bin/python3.7)
- <Environment: 3.5.3 in /usr> (/usr/bin/python3.5)
- <Environment: 2.7.13 in /usr> (/usr/bin/python2.7)
##### Settings
g:jedi#force_py_version = 3 (default: 'auto')
g:jedi#use_splits_not_buffers = 'bottom' (default: 1)
omnifunc=jedi#completions
Impostata l'ultima volta da ~/.vim/plugged/jedi-vim/autoload/jedi.vim
completeopt=menuone,noselect
Impostata l'ultima volta da ~/.vim/plugged/jedi-vim/autoload/jedi.vim
jedi-vim git version: f26b2a8-dirty
it's dirty because I updated manually the jedi submodule
This is the debug info if I run it in virtualenv (3.7.2), and removing the g:jedi#force_py_version
setting, no change
#### Jedi-vim debug information
##### jedi-vim version
- jedi-vim git version: f26b2a8-dirty
- jedi git submodule status: +8d0c4d3cec4973a2722652bf33f093ac3f1f385a pythonx/jedi (v0.13.3-19-g8d0c4d3c)
- parso git submodule status: acccb4f28d6d57f4ad4c882f3408136ee8f50ff5 pythonx/parso (v0.3.4)
##### Global Python
Using Python version 3 to access Jedi.
- global sys.version: `3.5.3 (default, Sep 27 2018, 17:25:39), [GCC 6.3.0 20170516]`
- global site module: `/usr/lib/python3.5/site.py`
##### Jedi
- path: `/home/gianmaria/.vim/plugged/jedi-vim/pythonx/jedi/jedi/__init__.py`
- version: 0.13.3
##### Jedi environment: <Environment: 3.7.2 in /home/gianmaria/.local/virtualenv/pybook>
- executable: /home/gianmaria/.local/virtualenv/pybook/bin/python
- sys_path:
- `/home/gianmaria/.local/virtualenv/pybook/lib/python37.zip`
- `/home/gianmaria/.local/virtualenv/pybook/lib/python3.7`
- `/home/gianmaria/.local/virtualenv/pybook/lib/python3.7/lib-dynload`
- `/home/gianmaria/.pyenv/versions/3.7.2/lib/python3.7`
- `/home/gianmaria/.local/virtualenv/pybook/lib/python3.7/site-packages`
##### Known environments
- <Environment: 3.7.2 in /home/gianmaria/.local/virtualenv/pybook> (/home/gianmaria/.local/virtualenv/pybook/bin/python)
- <Environment: 3.7.2 in /home/gianmaria/.local/virtualenv/pybook> (/home/gianmaria/.local/virtualenv/pybook/bin/python3.7)
- <Environment: 3.5.3 in /usr> (/usr/bin/python3.5)
- <Environment: 2.7.13 in /usr> (/usr/bin/python2.7)
##### Settings
g:jedi#use_splits_not_buffers = 'bottom' (default: 1)
omnifunc=jedi#completions
Impostata l'ultima volta da ~/.vim/plugged/jedi-vim/autoload/jedi.vim
completeopt=menuone,noselect
Impostata l'ultima volta da ~/.vim/plugged/jedi-vim/autoload/jedi.vim
I have modified quite a few things about imports on typeshed. So if you ever debug something, please do it on that Jedi branch. Can you quickly try checking out that branch and see if it fails there as well?
I really have no idea, because I haven't seen these issues before.
On typeshed, no change. Have you tried to create 2 files with the same paths, to see if you can reproduce it on your side? Because if you can't reproduce it, maybe it has to do with my system (debian stretch). Thanks
Works without problems. I'm running Ubuntu 16.04.
Thanks, then it's my system for sure.
Is there a special way how Dropbox mounts thing or deals with things in the file system?
None that I know of, but it seems to work outside Dropbox. Stopping Dropbox doesn't help though.
If you want to keep debugging this, you should use direct Jedi calls and check if it's a problem as well with jedi.Script().completions()
. If you enable debugging (jedi.set_debug_function()
), you can post that here as well. Would be interesting.
Ok thanks, how do I call jedi.set_debug_function() from vim?
:PythonJedi jedi_vim.jedi.set_debug_function()
But as I said, Jedi only calls would be even preferred. It's easier to debug and reason about those.
Ok I found out the cause. I had a file named os.py in the same directory and I didn't know it would mess up something. The debug helped a lot, thanks for that :). And sorry for the waste of time.
speed: init 29.534035682678223
speed: parsed 29.541239500045776
speed: init 1.043588399887085
speed: parsed 1.0510945320129395
speed: completions start 1.3113021850585938e-05
dbg: global completion scope: <ModuleContext: s2t@3-17>
speed: completions end 0.009578466415405273
speed: init 1.9056410789489746
speed: parsed 1.9118568897247314
speed: completions start 1.2636184692382812e-05
dbg: global completion scope: <ModuleContext: s2t@3-17>
speed: completions end 0.009280681610107422
speed: import (<Name: os@3,7>,) 0.009625673294067383
dbg: global search_module 'os' in '/home/gianmaria/Dropbox/Progetti/Python/Books/abs/s2t.py'
dbg: after import: ContextSet(<ModuleContext: os@1-33>)
speed: init 1.3616366386413574
speed: parsed 1.3653154373168945
speed: completions start 9.059906005859375e-06
dbg: eval_node <Name: os@7,3>@(7, 3)
dbg: finder.filter_name 'os' in (<ModuleContext: s2t@3-17>): [<TreeNameDefinition: os@(3, 7)>]@(7, 3)
speed: import (<Name: os@3,7>,) 0.001535654067993164
dbg: global search_module 'os' in '/home/gianmaria/Dropbox/Progetti/Python/Books/abs/s2t.py'
dbg: after import: ContextSet(<ModuleContext: os@1-33>)
dbg: finder._names_to_types: [<TreeNameDefinition: os@(3, 7)>] -> ContextSet(<ModuleContext: os@1-33>)
dbg: trailer completion contexts: ContextSet(<ModuleContext: os@1-33>)
speed: completions end 0.00455784797668457
speed: import (<Name: os@1,7>,) 0.0048978328704833984
dbg: after import: ContextSet(<ModuleContext: os@1-33>)
speed: import (<Name: zipfile@2,7>,) 0.005310773849487305
dbg: global search_module 'zipfile' in '/home/gianmaria/Dropbox/Progetti/Python/Books/abs/os.py'
dbg: after import: ContextSet(<ModuleContext: zipfile@1-1964>)
dbg: execute: <CompiledObject: <class 'str'>> <ValuesArguments: []>
dbg: execute result: ContextSet(<CompiledInstance of <CompiledObject: <class 'str'>>(<ValuesArguments: []>)>) in <CompiledObject: <class 'str'>>
dbg: execute: <CompiledObject: <class 'str'>> <ValuesArguments: []>
dbg: execute result: ContextSet(<CompiledInstance of <CompiledObject: <class 'str'>>(<ValuesArguments: []>)>) in <CompiledObject: <class 'str'>>
dbg: execute: <CompiledObject: <class 'str'>> <ValuesArguments: []>
dbg: execute result: ContextSet(<CompiledInstance of <CompiledObject: <class 'str'>>(<ValuesArguments: []>)>) in <CompiledObject: <class 'str'>>
dbg: execute: <CompiledObject: <class 'str'>> <ValuesArguments: []>
dbg: execute result: ContextSet(<CompiledInstance of <CompiledObject: <class 'str'>>(<ValuesArguments: []>)>) in <CompiledObject: <class 'str'>>
I can only add that the module was imported by python (os
methods could be called), only autocompletion doesn't seem to work in that case.
I will close this one then. It's really old and I doubt it's still an issue. The import system has been rewritten anyway. If anyone still thinks it's an issue, please open a new issue.
Issue
Ok, so I've just installed
jedi-vim
withvundle
and it seems to fail displaying documentation for at least a couple of libraries. For example, it says|No Docstring for <Definition module sys>|
and|No Docstring for <Definition module hashlib>|
.Steps to reproduce
First, here is my
.vimrc
:Then I try
Shift-k
onimport sys
orimport hashlib
and it gives me nothing.Output of “:verbose JediDebugInfo”
Jedi-vim debug information
Using Python version: 3
3.6.0 (default, Jan 16 2017, 12:12:55), [GCC 6.3.1 20170109]
/usr/lib/python3.6/site.py
Jedi path:/home/ddnomad/.vim/bundle/jedi-vim/jedi/jedi/__init__.py
/home/ddnomad/.vim/bundle/jedi-vim
/usr/lib/python36.zip
/usr/lib/python3.6
/usr/lib/python3.6/lib-dynload
/usr/lib/python3.6/site-packages
_vim_path_
Settings
:version
:messages
:scriptnames
``` 1: /etc/vimrc 2: /usr/share/vim/vimfiles/archlinux.vim 3: ~/.vimrc 4: /usr/share/vim/vim80/ftoff.vim 5: /usr/share/vim/vimfiles/autoload/vundle.vim 6: /usr/share/vim/vimfiles/autoload/vundle/config.vim 7: /usr/share/vim/vim80/filetype.vim 8: /usr/share/vim/vim80/ftplugin.vim 9: /usr/share/vim/vim80/indent.vim 10: /usr/share/vim/vim80/syntax/syntax.vim 11: /usr/share/vim/vim80/syntax/synload.vim 12: /usr/share/vim/vim80/syntax/syncolor.vim 13: ~/.vim/bundle/nerdtree/plugin/NERD_tree.vim 14: ~/.vim/bundle/nerdtree/autoload/nerdtree.vim 15: ~/.vim/bundle/nerdtree/lib/nerdtree/path.vim 16: ~/.vim/bundle/nerdtree/lib/nerdtree/menu_controller.vim 17: ~/.vim/bundle/nerdtree/lib/nerdtree/menu_item.vim 18: ~/.vim/bundle/nerdtree/lib/nerdtree/key_map.vim 19: ~/.vim/bundle/nerdtree/lib/nerdtree/bookmark.vim 20: ~/.vim/bundle/nerdtree/lib/nerdtree/tree_file_node.vim 21: ~/.vim/bundle/nerdtree/lib/nerdtree/tree_dir_node.vim 22: ~/.vim/bundle/nerdtree/lib/nerdtree/opener.vim 23: ~/.vim/bundle/nerdtree/lib/nerdtree/creator.vim 24: ~/.vim/bundle/nerdtree/lib/nerdtree/flag_set.vim 25: ~/.vim/bundle/nerdtree/lib/nerdtree/nerdtree.vim 26: ~/.vim/bundle/nerdtree/lib/nerdtree/ui.vim 27: ~/.vim/bundle/nerdtree/lib/nerdtree/event.vim 28: ~/.vim/bundle/nerdtree/lib/nerdtree/notifier.vim 29: ~/.vim/bundle/nerdtree/autoload/nerdtree/ui_glue.vim 30: ~/.vim/bundle/nerdtree/nerdtree_plugin/exec_menuitem.vim