-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
False positive on missing region for endregion comment #4496
Comments
@debonte, any thoughts on this one? |
However doing # region: foo
x = 5
# endregion: anything (not just 'foo') works just fine and doesn't produce the error, and this also works: # region
x = 5
# endregion |
We changed how we decide if a comment is a region/endregion for this issue: microsoft/pylance-release#3765. Seems like that may need some tweaking still. |
Thanks for the bug report. This will be addressed in the next release. |
I'll just add that this error has also triggered in a code that just had a comment that happened to start with a "region" word.
It's obviously easy to workaround by changing the position of the "region" word but just wanted to point it out, in case this is not supposed to trigger the error. I'm not sure if there is any spec for how those markers should work but I guess the match pattern could be a bit stricter and require the comment to either end after |
@rchl, unfortunately there's no standard for formatting Since the Pylance team owns this functionality, could you please file a new issue on this in the Pylance repo? https://github.com/microsoft/pylance-release/issues/new/choose |
This is included in pyright 1.1.291, which I just published. It will also be included in a future release of pylance. |
Describe the bug
After an update from 1.1.286 to 1.1.290, I'm experiencing a bug that falsly marks any
# endregion
comment as not having a matching# region
, even though it is present.To Reproduce
Create file with the following content:
Run pyright and notice an error on line 4, stating that endregion is missing a region.
Expected behavior
Pyright should be able to find the region tag above properly, and not report this error.
Screenshots or Code
The text was updated successfully, but these errors were encountered: