Skip to content
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

Diagnostics appear in stdlib in open file mode with Windows Store interpreter #1782

Closed
MinekPo1 opened this issue Sep 8, 2021 · 18 comments
Closed
Assignees

Comments

@MinekPo1
Copy link

MinekPo1 commented Sep 8, 2021

The problems tab is flooded by errors in libraries I have imported in my project (in this case unittest).

image

Is this intended behavior? If yes, how can I disable it, its really getting in my way.

@github-actions github-actions bot added the triage label Sep 8, 2021
@jakebailey
Copy link
Member

These files should not have diagnostics by default, so this sounds like a bug or misconfiguration. You didn't fill out our template; can you please provide info per https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue and your configuration?

@judej judej added the waiting for user response Requires more information from user label Sep 8, 2021
@github-actions github-actions bot removed the triage label Sep 8, 2021
@MinekPo1
Copy link
Author

MinekPo1 commented Sep 9, 2021

I apologize for not giving the necessary details; I have chosen the question preset, which did not have the necessary.

Python extension version: v2021.9.1191016588
Pylance version: v2021.9.1

Python version: 3.9.7 from Microsoft store.

Logs

Settings (filtered for python and pylance)

@jakebailey
Copy link
Member

Those are the logs from the Python extension; can you provide trace logs from the "Python Language Server" output window instead? The instructions I linked above should show how to enable and find them.

@MinekPo1
Copy link
Author

MinekPo1 commented Sep 9, 2021

Sorry, I way to often skim texts instead of reading them.

output.txt

@jakebailey
Copy link
Member

Ah, you're using open file mode. We have to know which files are actually user files (to know to ignore diagnostics in certain files), but that seems to be breaking with this interpreter. Normally, we exclude the interpreter's path, but it looks like the way the Windows Store installed version of Python is laid out is confusing that logic.

You should be able to work around this by opening a folder instead of a single file, which should more clearly help us define which files are actually in the workspace and which aren't.

@jakebailey jakebailey changed the title Disabeling analysis of imported modules. Diagnostics appear in stdlib in open file mode with Windows Store interpreter Sep 9, 2021
@jakebailey jakebailey added bug Something isn't working needs investigation Could be an issue - needs investigation and removed waiting for user response Requires more information from user labels Sep 9, 2021
@MinekPo1
Copy link
Author

MinekPo1 commented Sep 9, 2021

I had sadly encountered this problem in a folder workspace. The original screenshot was took in one. However I was, for whatever reason, not able to trigger the problem in either a workspace or in a file, not even on the projects from which the logs and the original screenshot were taken.

@jakebailey
Copy link
Member

I see, that does confuse things.

You're saying that you can't reproduce it anymore? We did do a release yesterday afternoon; potentially it was fixed.

@MinekPo1
Copy link
Author

MinekPo1 commented Sep 9, 2021

I had encountered it today, the logs were taken about the time I had uploaded them. VS code crashed (perhaps the debug messages were to much for this poor laptop) and after that I was not able to reproduce the errors. Perhaps it did update after the crash?

@jakebailey
Copy link
Member

Your crash in the original logs looked like #1586, which should be better handled next week, but would have only caused crashes in open-file mode.

@MinekPo1
Copy link
Author

MinekPo1 commented Sep 9, 2021

VS code crashed after those logs were created. When the crash occurred, I had multiple vscode windows open, a mix of files and workspaces. I'm afraid this is how much I have the energy to do today, so I will do more testing tomorrow.

@MinekPo1
Copy link
Author

I have experienced the bug again. I believe it is triggered when using tab complete on a import statement.

Screen recording

log.txt

@MinekPo1
Copy link
Author

MinekPo1 commented Sep 26, 2021

@jakebailey I apologize for the tagging you, but I have provided additional details.

@jakebailey
Copy link
Member

I'm not sure what I'm seeing in the above; your original issue was about diagnostics appearing in the stdlib, but the above doesn't show that. It seems to show some other diagnostic issue in the file where the diagnostic is in the wrong place (which isn't good either, of course).

@MinekPo1
Copy link
Author

I don't think the issue is were the library is placed, just using tab complete on it. The diagnostics were from the locally installed library (sorry for not showing it directly) I had imported. I can do it again with other libraries, if necessary, as now I know exactly hot to trigger it.

@judej
Copy link
Contributor

judej commented Apr 12, 2022

@MinekPo1, it has been a while and I'm wondering if you are still seeing this issue?

@MinekPo1
Copy link
Author

MinekPo1 commented Apr 12, 2022

@judej yes. I also opened #3261 which is somewhat related.

Would you like more information?

@heejaechang heejaechang self-assigned this Apr 19, 2022
@heejaechang
Copy link
Contributor

@MinekPo1 this issue contains multiple issues making it hard to answer.

the original issue is by design. we will show errors for any file that are explicitly opened in the editor.

The problems tab is flooded by errors in libraries I have imported in my project (in this case unittest).

for second issue linked #1782 (comment)
can you open new issue if it still repro? log shows somehow it takes 4 seconds to analyze 1 line bug.py file. analyzing why it takes so long will require a bit more info from you. and probably best if you can provide us repro steps we can follow to reproduce it ourselves.

@heejaechang heejaechang added by design and removed bug Something isn't working needs investigation Could be an issue - needs investigation labels Apr 19, 2022
@MinekPo1
Copy link
Author

the original issue is by design. we will show errors for any file that are explicitly opened in the editor.

I have not opened any files from unittest.

I have however opened a new issue microsoft/vscode-python#18953

I apologize that I have not added the proper info in this issue, however this was the first time I had approached such a system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants