You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect the comment to be part of the body in both these cases.
If this is intended, is there a good strategy to consider a leading comment as part of the body? If no body, check the node following the function_definition is a comment, and if there is a body check if previous siblings are comments?
The text was updated successfully, but these errors were encountered:
The same bug applies to the body blocks of with statements unfortunately. Consider:
withmanaged_resource(timeout=3600) asresource:
# Resource is released at the end of this block,# even if code in the block raises an exceptiona=42# hellob=19
The first two comment lines will be put between the with_clause and body: block, while the third comment is part of the body. The grammar cannot be the issue, as it only allows a block to follow the with clause and the colon:
I would expect the comment to be part of the body in both these cases.
If this is intended, is there a good strategy to consider a leading comment as part of the body? If no
body
, check the node following thefunction_definition
is a comment, and if there is abody
check if previous siblings are comments?The text was updated successfully, but these errors were encountered: