Closed simensol closed 1 week ago
You want to set ignore
rather than exclude
. For example:
"python.analysis.ignore": [".venv"]
exclude
allows you to carve out parts of include
to tell us that those parts are not really part of your project. However, if we analyze a file that imports an "excluded" file, we'll still analyze that excluded file and report diagnostics for it.
ignore
on the other hand tells us that you don't want to see diagnostics for certain files.
There's more information on these settings here.
Environment data
Code Snippet
I have tried to exclude
.venv
from bothsettings.json
andpyproject.toml
./workspaces/backend/.vscode/settings.json
/workspaces/backend/pyproject.toml
:Expected behavior
Errors should not be shown for Poetry’s virtual environment in
/workspaces/backend/.venv
.Actual behavior
Many errors are reported from Poetry’s virtual environment in
/workspaces/backend/.venv
. Sometimes restarting the language server fixes the issue, while other times reloading the VSCode window is necessary. This issue did not occur previously, but I do not recall when it started happening.Two examples from the same code base:
Logs
Top of verbose logs: