Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Long chains with some long arguments followed by method calls or property accesses could be more harmonious

Open
#360 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
58/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
tooling

Research direction

Start at the parser's chain-formatting logic, which currently adds backslashes and vertically aligns chained calls when the chain is too long. Use the provided GDScript example as the reproduction case; done means preserving the unwrapped first call and keeping the trailing method calls on one line when the long arguments already force a break.

Written by the indexing model from the issue text.

Description

From a course module we're working on. Input:

	tween.tween_method(
		func(t: float) -> void:
			if move_and_collide(start.lerp(destination, t) - global_position):
				tween.kill()
				_transition_to_state(State.NORMAL),
		0.0, 1.0, duration
	).set_trans(Hook.PULL_TRANS).set_ease(Hook.PULL_EASE)

Current output:

	tween \
			.tween_method(
		func(t: float) -> void:
			if move_and_collide(start.lerp(destination, t) - global_position):
				tween.kill()
				_transition_to_state(State.NORMAL),
		0.0,
		1.0,
		duration,
	) \
			.set_trans(Hook.PULL_TRANS) \
			.set_ease(Hook.PULL_EASE)

In this case, it's probably more readable as a result to keep the tail end of the chain after the long arguments on a single line if possible. And for the first line, we definitely want not to wrap.

The parser is seeing this as a chain too long to fit on a single line, and it tries to consistently add backslashes for vertical chains of method calls and align the property accesses/method calls vertically.

Desired output:

	tween.tween_method(
		func(t: float) -> void:
			if move_and_collide(start.lerp(destination, t) - global_position):
				tween.kill()
				_transition_to_state(State.NORMAL),
		0.0,
		1.0,
		duration,
	).set_trans(Hook.PULL_TRANS).set_ease(Hook.PULL_EASE)
Dominant language
Rust
Stars
458
Forks
40
Avg merge
1d 15h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GDQuest/GDScript-formatter

All issues in GDQuest/GDScript-formatter

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.