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

Format-on-save action doesn't re-save the buffer?

Aperta
#22 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

Esamina src/CodeFormatManager.ts intorno al flusso di onDidSave e applyTextEditsToBuffer, quindi leggi i casi correlati in spec/CodeFormatManager-spec.ts alle righe 80-115. Verifica se l’applicazione delle modifiche del provider lascia il buffer dirty e se è previsto un secondo TextBuffer::save; il lavoro è completato quando il comportamento è coperto dalle specs e corrisponde alla semantica di salvataggio prevista.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I know this repo is somewhat dormant, but I wanted to check in as a first step:

Suppose you've got a language server that can reformat an entire document on save. This package listens for onDidSave, debounces the event, then asks a provider to format the buffer. The edits are applied, and then… the buffer is not saved to disk again. The applyTextEditsToBuffer function delegates to a library function that explicitly says “the changes will be applied to the buffer but not saved.”

Judging by the specs, I don't think this was intentional behavior. This spec seems to verify that, when a provider has no edits to suggest, there are no further calls to TextBuffer::save; I think the implication there is that a second save would happen if the provider did supply edits, but it's hard to say.

Meanwhile, this spec verifies that a provider is invoked when an editor is saved, and that the resulting text matches expectations, but it does not check if the buffer is dirty.

If this was merely an oversight, I can submit a PR. If it's intentional behavior, perhaps it could be governed by a config setting? And if this package is unmaintained, that's fine, but I figured I'd ask before forking.

Lingua principale
TypeScript
Stelle
5
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

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 atom-community/atom-ide-code-format

Tutte le issue di atom-community/atom-ide-code-format

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.