-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add mypy's error code to the error diagnostic message #76
Comments
The error code is not part of the message. However, pylsp-mypy passes the error code with the message to pylsp which in turn gives it to your editor (as far as I know). The editor is then responsible for displaying it is so desired by the user. The only quick fix I can think of would be the ignore. Is there another you would like to see implemented? |
Adding
Thanks for the pointer, I'll double check if this is something that my LSP client can be configured to do. |
I think I've noticed the same problem with ruff, too. I get the description of the error, but not the actual code. I am using neovim's builtin LSP client. |
The code action is implemented now. From my testing client support was not as straight forward as I expected. Feel free to try the current master and tell me if it works. @ccordoba12 Quick question: Does Spyder support LSP code actions, because I did not find them. |
The quickfix action works well so far on master, I hadn't noticed any issues. Tested on vim-lsp. Thanks @Richardk2n! |
Use case
Whenever I want to add an
# type ignore[xxx]
for an error, I often need to recall what error code that this particular error message has.It would be nice if the diagnostic message produced by pylsp-mypy would also display the error code, similar to mypy's default error message on the CLI:
Additionally, it'd be even nicer if there's a code action that allows you to add an ignore line and/or automatically suggest some common quick fixes for some of the more common error codes.
The text was updated successfully, but these errors were encountered: