Format-on-save action doesn't re-save the buffer?
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di atom-community/atom-ide-code-format
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
atom-community/atom-ide-code-format#15 · 4 commenti ·
Tutte le issue di atom-community/atom-ide-code-format
Issue simili
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Crush Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
ElementsProject/cln-application#167 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Quantco/pnpm-licenses#17 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100