microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.33k stars 1.19k forks source link

No autocomplete/intellisense for new variables created in async functions #140

Closed DonJayamanne closed 5 years ago

DonJayamanne commented 6 years ago

From @applearound on July 14, 2017 21:18

Environment data

VS Code version: 1.14.1 Python Extension version: 0.6.7 Python Version: 3.6.1 OS and version: Windows 10 Professional 1703

Actual behavior

Define an async function. Define some variables in the function. Try to use them below but no autocomplete for them. And the variables outside the function work fine.

Like: 2017-07-15_05-08-58

Logs

VS Code doesn't show any error logs.

Copied from original issue: DonJayamanne/pythonVSCode#1084

MikhailArkhipov commented 6 years ago

I see image

brettcannon commented 6 years ago

Closing as fixed. 😄

Nessphoro commented 6 years ago

I would like to re-open this issue. It doesn't look like it has actually been fixed.

screenshot 2018-04-15 16 37 03
brettcannon commented 6 years ago

Please make sure you're running the latest version of the extension as I cannot reproduce: untitled

Nessphoro commented 6 years ago

@brettcannon Definitely the latest; I uninstalled it, and installed back again. It's using a Miniconda python 3.6 fresh environment on OS X.

brettcannon commented 6 years ago

Did you try re-installing the extension?

Nessphoro commented 6 years ago

Yes, I just tried it again, uninstalled, restarted VSCode, brought it back and installed 2018.3.1 -- same issue. If it makes sense, we can hop on Skype and debug it that way.

brettcannon commented 6 years ago

@Nessphoro do you have Jedi separately installed or specified in your settings.json?

Nessphoro commented 6 years ago

@brettcannon Nope, settings.json is pretty empty

{
    "python.pythonPath": "/Users/pmalynin/miniconda3/envs/winkel/bin/python"
}
brettcannon commented 6 years ago

But is Jedi installed in your environment or conda install? (I know this seems a little silly, but since you currently seem to be the only person on the planet with this issue I'm going on the assumption it's a configuration issue or installation issue. We're also looking to update our copy of Jedi in #1418 which might solve this for you if for some reason it is on our side.)

Nessphoro commented 6 years ago

@brettcannon I understand; Jedi has not been installed. Here is the print out from conda list

# packages in environment at /Users/pmalynin/miniconda3/envs/winkel:
#
aiodns                    1.1.1                     <pip>
aiohttp                   3.1.3                     <pip>
astroid                   1.6.3                     <pip>
async-timeout             2.0.1                     <pip>
attrs                     17.4.0                    <pip>
beautifulsoup4            4.6.0                     <pip>
certifi                   2016.2.28                py36_0  
chardet                   3.0.4                     <pip>
cssselect                 1.0.3                     <pip>
faiss-cpu                 1.2.1            py36_cuda0.0_1    pytorch
feedfinder2               0.0.4                     <pip>
feedparser                5.2.1                     <pip>
idna                      2.6                       <pip>
idna-ssl                  1.0.1                     <pip>
isort                     4.3.4                     <pip>
jieba3k                   0.35.1                    <pip>
lazy-object-proxy         1.3.1                     <pip>
lxml                      4.2.1                     <pip>
mccabe                    0.6.1                     <pip>
mkl                       2017.0.3                      0  
multidict                 4.2.0                     <pip>
newspaper3k               0.2.6                     <pip>
nltk                      3.2.4                    py36_0  
numpy                     1.13.1                   py36_0  
opencv-python             3.4.0.12                  <pip>
openssl                   1.0.2l                        0  
Pillow                    5.1.0                     <pip>
pip                       9.0.1                    py36_1  
pycares                   2.3.0                     <pip>
pylint                    1.8.4                     <pip>
python                    3.6.2                         0  
python-dateutil           2.7.2                     <pip>
PyYAML                    3.12                      <pip>
readline                  6.2                           2  
requests                  2.14.2                   py36_0  
requests-file             1.4.3                     <pip>
setuptools                36.4.0                   py36_1  
six                       1.11.0                    <pip>
six                       1.10.0                   py36_0  
sqlite                    3.13.0                        0  
tk                        8.5.18                        0  
tldextract                2.2.0                     <pip>
wheel                     0.29.0                   py36_0  
wrapt                     1.10.11                   <pip>
xz                        5.2.3                         0  
yarl                      1.1.1                     <pip>
zlib                      1.2.11                        0  

Also, I just created a completely new environment in conda:

screenshot 2018-04-17 13 42 44
# packages in environment at /Users/pmalynin/miniconda3/envs/cleanenv:
#
certifi                   2016.2.28                py36_0  
openssl                   1.0.2l                        0  
pip                       9.0.1                    py36_1  
python                    3.6.2                         0  
readline                  6.2                           2  
setuptools                36.4.0                   py36_1  
sqlite                    3.13.0                        0  
tk                        8.5.18                        0  
wheel                     0.29.0                   py36_0  
xz                        5.2.3                         0  
zlib                      1.2.11                        0 

And settings.json

{
    "python.pythonPath": "/Users/pmalynin/miniconda3/envs/cleanenv/bin/python"
}
brettcannon commented 6 years ago

I'm finally able to reproduce after our Jedi 0.12.0 upgrade.

var1 = 42

async def foo():
    var2 = False
    var  # Only lists var1.
brettcannon commented 6 years ago

I have reported this upstream to Jedi.

JesseTG commented 6 years ago

It looks like this has been fixed upstream, but you'll need to update your installation of jedi.

brettcannon commented 5 years ago

Closing as this is an upstream issue which we don't have direct control or influence over.