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

Errors disappear after saving any changes to file #88

Closed
levrik opened this issue Jul 14, 2023 · 3 comments
Closed

Errors disappear after saving any changes to file #88

levrik opened this issue Jul 14, 2023 · 3 comments

Comments

@levrik
Copy link

levrik commented Jul 14, 2023

Errors from mypy disappear after saving any change to a file. It doesn't matter if the change fixes an error, introduces a new error or is not related at all. Only reloading VS Code window fixes it until you make a change once again. This basically makes this extension unusable.

mypy-related settings in my settings.json:

{
  "python.linting.mypyEnabled": false
}

When set to false:

image

Errors only reported by Python extension.

When set to true:

image

Errors reported by this and Python extension.

After having saved changes when set to true:

image

Error from this extension disappears while the one from Python extension stays.

Logs of this extension after saving changes which cause errors to disappear:

2023-07-14 14:12:20.364 [info] /Users/levrik/code/<REDACTED>/.venv/bin/python -m mypy.dmypy --status-file /var/folders/y5/_yxr_tgx3xggc344718g4fp00000gn/T/.vscode.dmypy_status/status-f7231085-f699-494e-93e9-916f03e88602.json run -- --no-color-output --no-error-summary --show-absolute-path --show-column-numbers --show-error-code --no-pretty --follow-imports=normal --show-error-end /Users/levrik/code/<REDACTED>.py
2023-07-14 14:12:20.364 [info] [Trace - 2:12:20 PM] Received notification 'window/logMessage'.
2023-07-14 14:12:20.364 [info] CWD Server: /Users/levrik/code/<REDACTED>
2023-07-14 14:12:20.437 [info] [Trace - 2:12:20 PM] Received notification 'window/logMessage'.
2023-07-14 14:12:20.437 [info] file:///Users/levrik/code/<REDACTED>.py :

2023-07-14 14:12:20.439 [info] [Trace - 2:12:20 PM] Received notification 'textDocument/publishDiagnostics'.
@karthiknadig
Copy link
Member

@levrik This might be a bug in mypy itself. We don't specifically cache any result or do anything special here. You can try installing mypy in your environment and set "mypy-type-checker.path": ["${workspaceFolder}/.venv/bin/mypy"]. This will run mypy directly instead of using dmypy.

@karthiknadig
Copy link
Member

See python/mypy#15677

@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 2023
@karthiknadig karthiknadig pinned this issue Jul 14, 2023
@levrik
Copy link
Author

levrik commented Jul 17, 2023

@karthiknadig Thanks. Keeping an eye on the linked issue.

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

2 participants