phindle / error-lens

Visual Studio Code extension which enhances the display of errors and warnings.
https://marketplace.visualstudio.com/items?itemName=PhilHindle.errorlens
MIT License
89 stars 40 forks source link

Python(undefined-variable) false positiv on loops #28

Open GraphtyLove opened 5 years ago

GraphtyLove commented 5 years ago

Problem:

The extention warn you for Python(undefined-variable) on the loop variable that are in a class in python.

when I do a loop in a class i have an error.

Capture d’écran 2019-10-13 à 04 18 41 Capture d’écran 2019-10-13 à 04 20 07

Step to reproduce:

Make a python file, make a class, make a loop in it.

phindle commented 5 years ago

Thank you for the report. Could you try the following please and let me know what happens?: If you disable the ErrorLens extension, and restart VSCode, do you still see errors? (These will be red squiggles).

ErrorLens is only enhancing the highlighting of the diagnostics from the language service provider, so it's only showing the problems that the Python provider is passing to the ErrorLens extension.

I tried the code in your first screenshot, and this did not generate any undefined variables for my test (Using Python 3.6.8 on Linux).

GraphtyLove commented 5 years ago

There is no highlighting withtout on thoses varaibles errorLens. Using python 3.7.4 64bits on macOS. With:

Capture d’écran 2019-10-14 à 00 23 03

Without:

Capture d’écran 2019-10-14 à 00 22 52