GDQuest / GDQuest/GDScript-formatter

Make formater remember indentation of commented lines

Abierto
#204 7 comentarios 4 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
455
Forks
39
Merge medio
1 d 15 h
PR fusionados (30 d)
4

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:

``` gdscript
func _input(event: InputEvent) -> void:
if event is InputEventMouseButton:
if event.pressed:
if event.button_index == MOUSE_BUTTON_RIGHT:
print('test')
```

2) 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')
```

3) Formating the file

``` gdscript
#func _input(event: InputEvent) -> void:
#if event is InputEventMouseButton:
#if event.pressed:
#if event.button_index == MOUSE_BUTTON_RIGHT:
#print('test')
```

4) Uncomenting the lines (CTRL+K)

``` gdscript
func _input(event: InputEvent) -> void:
if event is InputEventMouseButton:
if event.pressed:
if event.button_index == MOUSE_BUTTON_RIGHT:
print('test')
```

Guía de contribución

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

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.

Evaluación

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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.