-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add fix for operators #129
base: main
Are you sure you want to change the base?
Conversation
|
||
def visit_variable(self, named_variable: VariableDeclarations.NamedVariable, p: P) -> J: | ||
v = cast(VariableDeclarations.NamedVariable, super().visit_variable(named_variable, p)) | ||
if v.padding.initializer is not None and v.padding.initializer.element is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we here probably need to limit this to method parameter declarations. Currently this would also apply to other variables (e.g. class fields or local variables). Or does the IntelliJ setting also apply to other types of variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this code is only relevant for the eq_in_named_parameter
and, more specifically, when it's set to False, which is not the default. I am not quite sure what the best approach here would be, so for now, I removed the snippet from this PR as the rest of the operators are independent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trick would be to use the cursor to check if the parent tree is a method declaration.
What's changed?
This PR adds many more tests for the around operators and corrects some bugs.
What's your motivation?
Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
Have you considered any alternatives or workarounds?
Any additional context
Checklist