You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intellisense for a module fails in the conditional block when same module used in the if-statement (works for if-not) #142
VS Code version: 1.14.1 (issue also present in 1.13.x)
Python Extension version: 0.6.7
Python Version: 2.7.12
OS and version: Ubuntu 16.04
Actual behavior
Intellisense for a specific module (and only this module) fails in the conditional block after the module is used in if-statement, does work for example after module is used in if-not-statement.
Expected behavior
The intellisense for the specific module should not break down depending on how it is used in a conditional statement.
Steps to reproduce:
Try the following example code, see intellisense is broken for the 'fails' cases, and is working for the 'works' cases.
import os
import sys
if not os.path.isfile('test.txt'):
works = os.path.isfile('test.txt')
if os.path.isfile('test.txt'):
fails = os.path.isfile('test.txt')
works = sys.version_info
fails = os.path.isfile('test.txt')
if sys.version_info is not None:
works = sys.version_info
if os.path.isfile('test.txt') is True:
fails = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is not False:
fails = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is not True:
works = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is False:
works = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is not None:
works = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is None:
fails = os.path.isfile('test.txt')
while os.path.isfile('test.txt'):
works = os.path.isfile('test.txt')
while os.path.isfile('test.txt') is True:
works = os.path.isfile('test.txt')
while os.path.isfile('test.txt') is not True:
works = os.path.isfile('test.txt')
Copied from original issue: DonJayamanne/pythonVSCode#1090
Activity
MikhailArkhipov commentedon Jan 9, 2018
Minimal repro
If I delete
:completion worksDonJayamanne commentedon Jan 11, 2018
Closing as upstream issue davidhalter/jedi#1025
MikhailArkhipov commentedon Feb 13, 2018
Looks like jedi 0.12+
MikhailArkhipov commentedon Apr 9, 2018
This works in VS engine
brettcannon commentedon Apr 19, 2018
Fixed thanks to the Jedi 0.12.0 upgrade.