gdformat collapses multiline-function call in chained function, exceeding line length
See original GitHub issueThis 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
)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Prettier does not respect existing method chain breaks #7884
I don't think that code expressing chained methods across multiple lines should be automatically collapsed by prettier .
Read more >How to prevent Visual Studio Code from pushing chained ...
The line length limit is reached; The user opts into it by manually inserting a newline, like object literals.
Read more >Python: Formatting Chained Methods - Ken Goettler
Chained method calls might be too long for a single line. ... a 79-character line length, the method must be broken up over...
Read more >489444 – [Formatter] Chained method calls when ... - Bugs
toList()); On the first line of code, I really do want the method calls to be chained together with no line splits. This...
Read more >Auto-indent lines feature wrongly indents multiline chained ...
Auto-indent lines feature wrongly indents multiline chained method calls ... and the tooltip warns: "PEP8: continuation line unaligned for hanging indent".
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fixed on
master
by f99c69d7b64dac281cac42dd952eb4e54c58e80a@rcorre the issues are solved in Godot’s
master
branch already.