microsoft / vscode-mypy

Linting support for Python using the mypy linter.
https://marketplace.visualstudio.com/items?itemName=ms-python.mypy-type-checker
MIT License
119 stars 26 forks source link

Blue underline not useful #252

Closed shaperilio closed 10 months ago

shaperilio commented 10 months ago

When a function is called with incorrect arguments, the call is underlined in squiggly red (great) and the entire function contents get underlined in squiggly blue. The tooltip on the blue is useless: " defined here". Well, duh, I have my pointer on it.

image

This means if I change a function signature, all that code turns blue until I got find all references to the function which use the old function.

Underlining potentially dozens of lines of code is not helpful. And the blue underlining of "this function is here" - looks totally random when you see it. The tooltip for the bad call does not have a button to take you to the definition, and vice versa. I can always right click on the red underlined bad function call and say "Go to Definition"; the other way is not so easy. So I don't see how underlining a bunch of code because an error exists in who-knows-what-other-file is helpful.

karthiknadig commented 10 months ago

@shaperilio We report whatever mypy reports as an issue. You can see Output > Mypy Type Checker for the result.

shaperilio commented 10 months ago

Are you telling me mypy is telling you to underline entire functions in blue?

It's not easy to sift through the output. Even with settings which I believe mean "only check the currently open files", and with only one file open, I'm getting errors throughout my codebase. It takes several seconds to update as a result.

karthiknadig commented 10 months ago

Are you telling me mypy is telling you to underline entire functions in blue?

That is correct. Here is how mypy tells us: image

It gives us the line and column number ranges to highlight. The color itself is based on severity level which is indicated by 'error', 'note', etc tags on the message.

shaperilio commented 10 months ago

I see you have a play repo already set up. What does it show for my particular issue?

karthiknadig commented 10 months ago

I don't have it set up for your particular issue. You should be able to see that in the logs. You can clear the logs before opening the file to see the results just for that file (if you have reportingScope set as file)

karthiknadig commented 10 months ago

Duplicate of https://github.com/microsoft/vscode-mypy/issues/251

Considering this as duplicate since #251 is also about range of squiggles shown for a given issue.