Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#360 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
58/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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)
Lenguaje dominante
Rust
Estrellas
458
Forks
40
Merge medio
1 d 15 h
PR fusionados (30 d)
4

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de GDQuest/GDScript-formatter

Todos los issues de GDQuest/GDScript-formatter

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.