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

Make formater remember indentation of commented lines

Abierto
#204 7 comentarios 4 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

No se especifica ningún archivo fuente ni ninguna prueba. Empieza reproduciendo el ejemplo numerado de GDScript y sigue el tratamiento que hace el formateador de las líneas comentadas; el trabajo estará terminado cuando el formateo conserve su indentación, de modo que al quitarles los comentarios se restaure un anidamiento válido, y el comportamiento solicitado esté cubierto por una prueba de regresión.

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

Descripción

Hello,

I often quickly multiline comment functions or part of the code when refactoring.
Unfortunately the formater remove the indentation, so when uncommenting, the function is not valid anymore
In my current workflow, I have to disable the formater for now :(

Would it be possible to add an option to avoid that ?

Note: I do know about """ for commenting but not a huge fan of them, and the formater move them to the end of the file

Thanks you

Steps to reproduce:

  1. Original Function:
func _input(event: InputEvent) -> void:
	if event is InputEventMouseButton:
		if event.pressed:
			if event.button_index == MOUSE_BUTTON_RIGHT:
				print('test')
  1. Adding multiline comments (CTRL+K)
#func _input(event: InputEvent) -> void:
	#if event is InputEventMouseButton:
		#if event.pressed:
			#if event.button_index == MOUSE_BUTTON_RIGHT:
				#print('test')
  1. Formating the file
#func _input(event: InputEvent) -> void:
#if event is InputEventMouseButton:
#if event.pressed:
#if event.button_index == MOUSE_BUTTON_RIGHT:
#print('test')
  1. Uncomenting the lines (CTRL+K)
func _input(event: InputEvent) -> void:
if event is InputEventMouseButton:
if event.pressed:
if event.button_index == MOUSE_BUTTON_RIGHT:
print('test')
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.