-
Notifications
You must be signed in to change notification settings - Fork 38
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
Can't ignore reportUnreachable when typeCheckingMode == "standard" #590
Comments
i can't seem to reproduce your issue. in both those basedpyright playground links you sent, the (ideally you wouldn't need to suppress the error though in cases where you expect your code to be run on multiple python versions: #8) |
I believe the issue is that the ignore in the first example is invalid, and there is no way to suppress the unreachable effect Additionally, with |
weird, there seems to be some intermittent issue with the playground that prevented the unreachable diagnostic from appearing in some cases, which is why i thought both those playground links were showing the same thing. (DetachHead/basedpyright-playground#21)
this is intentional and caused by #326. since as for why the you can turn off |
Thanks for looking into it – it sounds like a complicated situation. The hint is pretty unobtrusive in VS Code, but in Neovim and Helix, it's treated the same as any other diagnostic, so it's a bit harder to ignore (it's possible to configure the editor itself to suppress it, but that's not ideal, either). It'd be nice to tell the language server "I know you think this code is unreachable, but it's actually fine" and keep reporting other cases that haven't specifically been approved, but from my end, just turning off the rule is fine (and #8 would resolve this specific issue in an even better way). Feel free to close this! |
Given this script (playground):
I'd expect that the code in the condition would not be marked as unreachable. In fact, when
typeCheckingMode == "all"
, the code is not marked (playground).Pyright seems to suffer from the same issue, both in standard and strict mode (playground), but it'd be a nice improvement if it did work here (unless I'm misunderstanding something about the setting).
The text was updated successfully, but these errors were encountered: