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 }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Linter does not detect undefined variable in constructor #2068
Nothing happens when using "Python: Run Linting" and there are no messages printed in the "Python" Output screen. I am running on a file for which I have known errors and for which pylint works correctly in the integrated terminal when I run it manually.
Value of the python.languageServer setting: Microsoft
Steps to reproduce:
Create a file with the following two lines:
x = 3
print(y)
Run the command "Python: Run Linting".
Logs
No log appears in Output for Python code or Developer panel. However, there is a Python error (jediProxy Error) that shows up in the Developer panel. Details are provided in the Logs section below.'
Output for Python in the Output panel:
Nothing from the command gets printed here
Output from Console under the Developer Tools panel:
Please try to find the Python output channel here,
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
Unfortunately without it, there's not much we can do.
Also, can you try installing an older version of the extension (for example 2020.4.58038), and see if your problem happens?
You can follow the prompts from "Extensions: Install Specific Version of Extension..." in the command palette:
Or you can open the extensions side bar, click on the settings for the Python extension and pick "Install Another Version...":
After installing different versions (v2020.4.76186 and v2020.5.80290) and digging a little further, I noticed that some errors were being picked up, but not others. And, this is happening in both versions of the extension I installed.
Here is a new test case:
XX = 3
print(y)
class TestIt():
def __init__(self):
self.x = 5
slf.y = 6
I expect vscode to produce two Problems in the Problems window associated with the undefined variables y in the second line and slf in the last line. However, the Problems window only shows the first of these two:
Undefined variable: 'y'
Running manually in the terminal window provides the output I expect
My Python Output Window (while running extension v2020.4.76186)
User belongs to experiment group 'AlwaysDisplayTestExplorer - control'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'WebHostNotebook - control'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'NativeNotebook - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - control'
> conda --version
> pyenv root
> python3.7 ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> /usr/bin/python3 ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> conda info --json
Python interpreter path: /usr/bin/python3
Starting Microsoft Python language server.
> /usr/bin/python3 ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import jupyter"
> /usr/bin/python3 ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import jupyter"
> /usr/bin/python3 ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import notebook"
> /usr/bin/python3 ~/.vscode-server-insiders/extensions/ms-python.python-2020.4.76186/pythonFiles/pyvsc-run-isolated.py -c "import notebook"
> conda --version
> /usr/bin/autopep8 --diff ~/git/SheetMusicViewer/junk3.py.4dc18e947ccc0718999d843d3930fa9f.py
cwd: ~/git/SheetMusicViewer
Experiencing same problem, running python linting shows nothing (including output: python). Check 'Jedi Enabled' and pylint works well immediately. In my case it seems the problem is not related to recent versions, tried downgrade to 2020.1, still no hint
crazyapril (@crazyapril) Your issue seems to be that Pylint is not working when using Python Language server as intellisense. We've an open issue for that.
Activity
karrtikr commentedon Jun 8, 2020
Please try to find the Python output channel here,
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)Unfortunately without it, there's not much we can do.
Also, can you try installing an older version of the extension (for example
2020.4.58038), and see if your problem happens?You can follow the prompts from "Extensions: Install Specific Version of Extension..." in the command palette:
Or you can open the extensions side bar, click on the settings for the Python extension and pick "Install Another Version...":
jrsrjrsr commentedon Jun 8, 2020
Hi,
After installing different versions (v2020.4.76186 and v2020.5.80290) and digging a little further, I noticed that some errors were being picked up, but not others. And, this is happening in both versions of the extension I installed.
Here is a new test case:
I expect vscode to produce two Problems in the Problems window associated with the undefined variables
yin the second line andslfin the last line. However, the Problems window only shows the first of these two:Running manually in the terminal window provides the output I expect
My Python Output Window (while running extension v2020.4.76186)
crazyapril commentedon Jun 9, 2020
Experiencing same problem, running python linting shows nothing (including output: python). Check 'Jedi Enabled' and pylint works well immediately. In my case it seems the problem is not related to recent versions, tried downgrade to 2020.1, still no hint
karrtikr commentedon Jun 9, 2020
crazyapril (@crazyapril) Your issue seems to be that Pylint is not working when using Python Language server as intellisense. We've an open issue for that.
karrtikr commentedon Jun 9, 2020
Actually Language server is one providing the linting here, not pylint.
LS only shows one error
Undefined variable: 'y'while pylint shows two, transferring to LS.[-]No output when running pylint linter[/-][+]Linter does not detect undefined variable in constructor[/+]