Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Language Server incorrectly marks variables as undefined in nested list comprehensions #387

Closed
DonJayamanne opened this issue Nov 12, 2018 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@DonJayamanne
Copy link

From @mawright on November 11, 2018 3:38

Environment data

  • VS Code version: 1.28.2
  • Extension version (available under the Extensions sidebar): 2018.10.1
  • OS and version: Ubuntu 16.04
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

screenshot from 2018-11-10 19-32-37

Expected behavior

Linter does not incorrectly mark variable as undeclared

Steps to reproduce:

  1. See screenshot

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Microsoft Python language server.
Microsoft Python Language Server version 0.1.60.0
Initializing for /home/matt/anaconda3/envs/learn/bin/python

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:1409  INFO no standard startup: not a new window
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4274 Overwriting grammar scope name to file mapping for scope source.python.
Old grammar file: file:///usr/share/code/resources/app/extensions/python/syntaxes/MagicPython.tmLanguage.json.
New grammar file: file:///home/matt/.vscode/extensions/magicstack.magicpython-1.1.0/grammars/MagicPython.tmLanguage
e.register @ /usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4274
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] vscode-icons is active!
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Create file systemwatcher with pattern */python
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Create file systemwatcher with pattern */*/python
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Register Intepreter Watcher, Arg 1: undefined, Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Build the workspace interpreter watcher, Arg 1: undefined, Return Value: UNABLE TO DETERMINE VALUE
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Get language server folder name, , Return Value: "languageServer.0.1.60"
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Git extension API method 'getGitPath' is deprecated.
t.log @ /usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 

Copied from original issue: microsoft/vscode-python#3297

@DonJayamanne
Copy link
Author

From @darrickyee on November 11, 2018 14:54

I think this is a language server issue, not a linting issue. The message is not prefixed with [pylint] and still appears when pylint is disabled.

@DonJayamanne DonJayamanne changed the title Linter doesn't understand nested list comprehensions, incorrectly marks variables as undefined Language Server incorrectly marks variables as undefined in nested list comprehensions Nov 12, 2018
@jakebailey jakebailey self-assigned this Nov 14, 2018
@jakebailey jakebailey added this to the Nov 2018.2 milestone Nov 14, 2018
@jakebailey jakebailey added the bug Something isn't working label Nov 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants