microsoft / microsoft/vscode-pull-request-github
Generated code suggestion can't be applied to the file correctly
オープン
@alexr00 がすでに取り組んでいます。
2024年8月27日 から。
bug
- 主要言語
- TypeScript
- スター
- 2.6k
- フォーク
- 796
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 46
説明
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
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。