coc-jedi
coc-jedi copied to clipboard
Cannot open Pip module documentation when imported as alias
It seems like coc-jedi
doesn't follow aliased imports when looking up documentation.
For example in the code snippet below, the lookup (using showDocumentation
) for numpy.ones
works but for np.ones
it tells me that it cannot find the documentation.
import numpy as np
import numpy
a = np.ones((1, 2))
b = numpy.ones((1, 2)
I'm using coc-jedi
without the jedi-language-server
package and in a virtual environment. I guess this could be considered a feature request.
Sorry you're experiencing this! That said, I cannot reproduce on my end.
Would you be able to describe as many specifics about your environment that you can think of? For example, which OS, which Python version, how you're installing coc-jedi
, etc?
Hey, thanks for the quick reply, my system is as follows:
OS: Ubuntu 20.04 on WSL2 Python: 3.9.7 Virtual environment: conda
I'm installing coc-jedi
using vim-plug
for neovim
.
I played around with this a bit more and I'm starting to get better results after fixing some loose ends in my PYTHONPATH
, progress means jump definition is now working consisntely well which was also failing before. However, showing the documentation for aliases or even imported modules, i.e. from collections import defaultdict
, is still failing and just showing this message:
No Python documentation found for 'defaultdict'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.
This issue is directly related to an existing issue: our default conda
support: https://github.com/pappasam/coc-jedi/issues/4
Basically, if might be a good idea for us to determine whether the user is using conda
(or to at least provide a configuration option for conda
). If you're willing to play around a bit, a good place in the code to start might he here: https://github.com/pappasam/coc-jedi/blob/171c3da4e4edaebb2f4df4c87d1ef1afadb1fc84/src/jlsExecutable.ts#L58-L70
@mxkrn would you be able to test out the latest release and see if it resolves your issue with conda? The latest release solved a problem with system-site-packages for normal virtual environments and I'm wondering if that fix may have inadvertently resolved this issue too? If it hasn't, then we can keep trying a conda-specific approach.
@pappasam Took me a while but I finally got around to checking out the latest release, jump definition has improved and now also finds all aliased imports. However, for some reason it shows me twice the same definition option (duplicated) to jump to.
Documentation has improved in that it finds it, the problem is that it just briefly shows the docs and then it immediately disappears. (see gif)