forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Description
From @bgse on July 17, 2017 12:6
Environment data
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
Metadata
Metadata
Assignees
Labels
area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug