-
Notifications
You must be signed in to change notification settings - Fork 767
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
Basic type checking raises a problem which goes away upon further inspection. #1356
Comments
Can you see if disabling semantic tokenization makes this issue go away?
We've seen in the past that these odd intermittent issues were related to the way the semantic tokenizer walks the code compared to a typical checker run. |
Thanks for the bug report. I cloned your repo and tried to repro the problem, but I haven't been able to yet. So there must be some missing step or configuration. In addition to what Jake suggested above, here are some additional questions: Is there a specific action that consistently causes the problem? You mention that it happens when saving a file. Normally the type analyzer runs only when a file's contents change. Do you have "format on save" enabled and a formatter configured? If so, that would explain why the type analyzer runs when you save. When you see these errors reported, is the file associated with those errors currently open in the editor (e.g. in a background tab)? Or is the file closed? Are you using the default setting for "python.analysis.diagnosticMode"? By default, it's set to "openFilesOnly". I'm curious whether you've set it to "workspace" instead. Are there any other pylance settings (of the form "python.analysis.xxx") that you've set in your local VS Code settings? |
@erictraut & @jakebailey [
"editor.semanticHighlighting.enabled": false
] I found that it would no longer fix when inspected. Rather it would continue to assert that: I am using the workspace setting for the diagnostic mode. [
"python.analysis.diagnosticMode": "workspace",
"python.analysis.completeFunctionParens": true,
"python.analysis.typeCheckingMode": "basic"
] I currently am able to produce the error that will not go away while the file is open: |
Thanks for the additional details. I'm able to repro the problem now. I'll investigate the cause. |
I found and fixed the underlying cause of the bug. It will be fixed in the next release. |
We'll leave the bug open until it is released. |
This issue has been fixed in version 2021.6.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202160-2-june-2021 |
Environment data
Expected behaviour
No type error in file tile.py.
Actual behaviour
Two errors related to an array2d 's size parameter. The message as shown below states that it cannot access member "size" from type "Unbound".
This error occurs at random when saving files or other actions which might cause the language server to access the file. When the error is clicked on and the file navigated to the error clears after a few moments.
Logs
Code Snippet / Additional information
for the full source code of my project it can be found at
https://github.com/xenten9/game-x
The text was updated successfully, but these errors were encountered: