microsoft / microsoft/vscode-pull-request-github
Generated code suggestion can't be applied to the file correctly
Aperta
@alexr00 ci sta già lavorando.
Dal 27/8/2024.
bug
- Lingua principale
- TypeScript
- Stelle
- 2.6k
- Fork
- 796
- Merge medio
- 1g 4h
- PR unite (30g)
- 46
Descrizione
Testing #6160
Initial code
preserveElements(indexes: number[]): void {
this.preservedItems.clear();
for (const index of indexes) {
if (index >= 0 && index < this.items.length) {
const item = this.items[index];
this.preservedItems.add(item);
if (!item.row) {
this.insertItemInDOM(index);
}
this.updateItemInDOM(item, index);
}
}
}
new code
preserveElements(indexes: number[]): void {
this.preservedItems.clear();
let updatePreservedElements = false;
for (const index of indexes) {
if (index >= 0 && index < this.items.length) {
const item = this.items[index];
this.preservedItems.add(item);
if (!item.row) {
this.insertItemInDOM(index);
updatePreservedElements = true;
}
this.updateItemInDOM(item, index);
}
}
if (updatePreservedElements) {
this.rerender();
}
}
The generated code suggestion
let updatePreservedElements = false;
for (const index of indexes) {
if (index >= 0 && index < this.items.length) {
const item = this.items[index];
this.preservedItems.add(item);
if (!item.row) {
this.insertItemInDOM(index);
updatePreservedElements = true;
}
}
}
if (updatePreservedElements) {
this.rerender();
}
However when applied to the editor, the file was in a broken state
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.
Valutazione
Questa issue non è ancora stata valutata.