Replacing an id-less script by its synthetic location appends instead of replacing on the draft path
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Start in the writer's _upsert_top_level_list and compare its handling with require_instance, which already falls back to the parser's positional label for id-less component instances. Trace how synthetic script locations are resolved when no item has that id; done means replacing the parsed row positionally and returning a success diff without appending a duplicate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
An id-less top level script: entry parses to a synthetic location (script_<index>), and _upsert_top_level_list matches list items by their id field, so a replace aimed at that synthetic id matches nothing and appends a duplicate instead. The guarded path (#2788, save or expected) refuses this after the fact; the editor's auto-apply path is unguarded by design (parse free per keystroke) and returns a success diff with the duplicate.
Fix belongs in the writer: resolve a synthetic script_<index> location positionally when no item carries that id, the way _require_instance already falls back to the parser's positional label for id-less component instances, so the replace lands on the row the parser listed.
Raised by esphbot on #2788.
- Lingua principale
- Python
- Stelle
- 111
- Fork
- 34
- Merge medio
- 7h 59m
- PR unite (30g)
- 135
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 esphome/device-builder
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 64/100
esphome/device-builder#2804 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 75/100
esphome/device-builder#2800 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
esphome/device-builder#2797 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 70/100
esphome/device-builder#2796 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
esphome/device-builder#2795 ·
Tutte le issue di esphome/device-builder
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100