gdformat collapses multiline-function call in chained function, exceeding line length
This file is formatted correctly:
extends Node
func _physics_process(delta: float):
var move_target := Vector2(
Input.get_action_strength("right") - Input.get_action_strength("left"),
Input.get_action_strength("forward") - Input.get_action_strength("backward")
)
Now add a method call on the end:
extends Node
func _physics_process(delta: float):
var move_target := Vector2(
Input.get_action_strength("right") - Input.get_action_strength("left"),
Input.get_action_strength("forward") - Input.get_action_strength("backward")
).rotated(20)
gdformat collapses it into one line, breaking the line length restriction:
extends Node
func _physics_process(delta: float):
var move_target := Vector2(Input.get_action_strength("right") - Input.get_action_strength("left"), Input.get_action_strength("forward") - Input.get_action_strength("backward")).rotated(
20
)
Actually that's expected - due to several Godot bugs (like e.g. https://github.com/Scony/godot-gdscript-toolkit/blob/master/tests/potential-godot-bugs/multiline-attribute-expression.gd) it's not possible to implement it the way I want.
Thus it will be addressed for 4.0 or 4.x.
As a workaround, I can only recommend introducing an extra variable or modifying move_target inplace.
Thanks! Do you happen to know which Godot issues, so I can track them?
@rcorre the issues are solved in Godot's master branch already.
fixed on master by f99c69d7b64dac281cac42dd952eb4e54c58e80a