-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Language server not recognising True or False as builtins #3274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Interesting, I cannot replicate this at my end. |
i have the same issue; even a simple test case like this triggers it: if True:
print "hi" VS Code version: 1.28.2 and 1.29.0 |
I can make this happen on my machine, but only once, then it goes away for all files. I'll look into this upstream (and keep discussion there). |
This issue was moved to microsoft/python-language-server#394 |
I can no longer replicate this issue within the same project for what it's worth. |
I can't either, unfortunately. Making it very hard to track down... |
Ok, I have been able to replicate this in my python 2.7 project. When the project is first opened everything is fine. I notice that once the project has finished being analysed I see the underlining of True/False with use before def error. I'm not sure if the warning is shown some time before analysis is completed though - as it takes about 10 minutes on my project and watching a single value for that long is tricky. |
I have had it consistently for many weeks.
EDIT: I spoke too soon. I have disabled Python Extension Pack but the selected language mode still shows as "Magic Python"
I still have many: Visual Studio IntelliCode - Preview is on. No other python extensions enabled. |
I have this issue as well, amongst other random/erroneous things that Python linter reports as being used before definition. ( |
This is an upstream issue with the language server. If you have issues with True/False beign reported as use-before-def, we'd appreciate it if you could report it in microsoft/python-language-server#391, or create a new issue if it's detecting something other than True/False as use-before-def. I've been attempting to reproduce this for the past few weeks without any luck, so if you can make it happen consistently in some setup, I'd appreciate knowing (again, in the other repo's issue tracker). |
Fixed upstream. |
Environment data
Language Server: Microsoft Python Language Server version 0.1.60.0 (from startup logs)
Actual behavior
False and True are now being marked as use before defined, suggesting they're no longer recognised as built ins.
Expected behavior
The poor booleans are not targeted as being issues.
Steps to reproduce:
See screenshot above.
The text was updated successfully, but these errors were encountered: