Skip to content

Commit

Permalink
[OneExplorer] Fix to use then phrase (#1212)
Browse files Browse the repository at this point in the history
`refresh()` was sometimes called after `rename(...)` is not yet finished.
This commit fixes it by using then phrase.

ONE-vscode-DCO-1.0-Signed-off-by: Seok NamKoong <[email protected]>
  • Loading branch information
llFreetimell authored Aug 11, 2022
1 parent ea95150 commit c53d69b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OneExplorer/OneExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,9 @@ export class OneTreeDataProvider implements vscode.TreeDataProvider<OneNode> {
if (newname) {
const dirpath = path.dirname(oneNode.node.uri.fsPath);
const newpath = `${dirpath}/${newname}`;
vscode.workspace.fs.rename(oneNode.node.uri, vscode.Uri.file(newpath));

this.refresh();
vscode.workspace.fs.rename(oneNode.node.uri, vscode.Uri.file(newpath)).then(() => {
this.refresh();
});
}
});
}
Expand Down

0 comments on commit c53d69b

Please sign in to comment.