This is a fix for an AttributeError when adding a leading comment to an Importance that invokes SyntaxNode._grab_beginning_comment which previously was only implemented for PaddingNode. This implements it for SyntaxNodeBase and SyntaxNode which should cover all other use cases.
This also adds a final check to ensure no extra blank lines are being added.
Fixes #580
Checklist
[x] I have performed a self-review of my own code
[x] I have added tests that prove my fix is effective or that my feature works (if applicable)
Description
This is a fix for an AttributeError when adding a leading comment to an
Importance
that invokesSyntaxNode._grab_beginning_comment
which previously was only implemented forPaddingNode
. This implements it forSyntaxNodeBase
andSyntaxNode
which should cover all other use cases.This also adds a final check to ensure no extra blank lines are being added.
Fixes #580
Checklist