GDQuest / GDQuest/GDScript-formatter
Make formater remember indentation of commented lines
- Lingua principale
- Rust
- Stelle
- 455
- Fork
- 39
- Merge medio
- 1g 15h
- PR unite (30g)
- 4
Descrizione
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')
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Non sono indicati né un file sorgente né un test. Inizia riproducendo l'esempio numerato di GDScript e traccia il comportamento del formatter nei confronti delle righe commentate; il lavoro è completo quando la formattazione ne preserva l'indentazione, così che rimuovendo i commenti venga ripristinato un annidamento valido, e il comportamento richiesto sia coperto da un test di regressione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100