Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Make formater remember indentation of commented lines

Aperta
#204 7 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust
Ambito
tooling

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.

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:
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')
Lingua principale
Rust
Stelle
458
Fork
40
Merge medio
1g 15h
PR unite (30g)
4

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GDQuest/GDScript-formatter

Tutte le issue di GDQuest/GDScript-formatter

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.