提交 db9cddaa 编写于 作者: I isidor

explorer: do not allow to creatae a new file / folder while in the process of creating a new file

fixes #47606
上级 46386015
......@@ -378,13 +378,14 @@ export class ExplorerItem {
/* A helper that can be used to show a placeholder when creating a new stat */
export class NewStatPlaceholder extends ExplorerItem {
public static NAME = '';
private static ID = 0;
private id: number;
private directoryPlaceholder: boolean;
constructor(isDirectory: boolean, root: ExplorerItem) {
super(URI.file(''), root, false, false, '');
super(URI.file(''), root, false, false, NewStatPlaceholder.NAME);
this.id = NewStatPlaceholder.ID++;
this.isDirectoryResolved = isDirectory;
......
......@@ -391,6 +391,10 @@ export class BaseNewAction extends BaseFileAction {
if (!folder) {
return TPromise.wrapError(new Error('Invalid parent folder to create.'));
}
if (!!folder.getChild(NewStatPlaceholder.NAME)) {
// Do not allow to creatae a new file/folder while in the process of creating a new file/folder #47606
return TPromise.as(new Error('Parent folder is already in the process of creating a file'));
}
return this.tree.reveal(folder, 0.5).then(() => {
return this.tree.expand(folder).then(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册