Add code action to ignore current error?
basedpyright's type checking is helpful, but sometime I'd just want to ignore the error for the 3rd library without manually typing # pyright: ignore[reportUnknownVariableType,reportUnknownMemberType]...
i've thought about this before, but i'm hesitant to add this because i've seen other tools do it and it seems to encourage users to just apply the code action to suppress the error without thinking about it. from what i've seen, forcing the user to write the ignore comment manually encourages them to consider whether or not that's really the best solution.
maybe we can add the functionality but with an option to turn it off
For me, most of time whenever I saw a unsolvable lint, I think carefully, then look up the code(because Zed does not show it in the popup), and type the comment.
I think most people who use baesdpyright do care about type checking as it is stricter and more accurate than pyright. So most of them will not apply the code action blindly otherwise they won’t prefer basedpyright.
I think most people who use baesdpyright do care about type checking as it is stricter and more accurate than pyright. So most of them will not apply the code action blindly otherwise they won’t prefer basedpyright.
that's a fair point. i guess my experience is with my team at work who i've forced to use basedpyright, as well as linters like ruff on the strictest settings. many of them probably would turn them all off if they had the choice lol
also worth keeping in mind that i believe the majority of basedpyright users still turn off most of the type checking and only care about language server features like autocomplete, semantic highlighting, etc.. to many people, basedpyright is just a language server and they couldn't care less about type checking. but i guess those users won't be seeing these diagnostics anyway
only include the option when type checking is set to all / recommended
maybe we can add the functionality but with an option to turn it off
I think it would be better if you add this option, but it should be disabled by default. Developers who really need it (who know how to write code) can read the docs and enable this feature.
looks like pylance has this functionality (see https://github.com/DetachHead/basedpyright/issues/1245#issuecomment-2819832218), so we should add it too
Some editors make the error code hard to be discovered, so this could be really helpful...