提交 c09aac5d 编写于 作者: I isidor

inline PLACEHOLDER_URI

上级 1134b213
...@@ -94,7 +94,6 @@ export class BaseErrorReportingAction extends Action { ...@@ -94,7 +94,6 @@ export class BaseErrorReportingAction extends Action {
} }
} }
const PLACEHOLDER_URI = URI.file('');
function refreshIfSeparator(value: string, explorerService: IExplorerService): void { function refreshIfSeparator(value: string, explorerService: IExplorerService): void {
if (value && ((value.indexOf('/') >= 0) || (value.indexOf('\\') >= 0))) { if (value && ((value.indexOf('/') >= 0) || (value.indexOf('\\') >= 0))) {
// New input contains separator, multiple resources will get created workaround for #68204 // New input contains separator, multiple resources will get created workaround for #68204
...@@ -137,7 +136,7 @@ export class NewFileAction extends BaseErrorReportingAction { ...@@ -137,7 +136,7 @@ export class NewFileAction extends BaseErrorReportingAction {
return Promise.reject(new Error('Parent folder is readonly.')); return Promise.reject(new Error('Parent folder is readonly.'));
} }
const stat = new NewExplorerItem(PLACEHOLDER_URI, folder, false); const stat = new NewExplorerItem(folder, false);
return folder.fetchChildren(this.fileService, this.explorerService).then(() => { return folder.fetchChildren(this.fileService, this.explorerService).then(() => {
folder.addChild(stat); folder.addChild(stat);
...@@ -205,7 +204,7 @@ export class NewFolderAction extends BaseErrorReportingAction { ...@@ -205,7 +204,7 @@ export class NewFolderAction extends BaseErrorReportingAction {
return Promise.reject(new Error('Parent folder is readonly.')); return Promise.reject(new Error('Parent folder is readonly.'));
} }
const stat = new NewExplorerItem(PLACEHOLDER_URI, folder, true); const stat = new NewExplorerItem(folder, true);
return folder.fetchChildren(this.fileService, this.explorerService).then(() => { return folder.fetchChildren(this.fileService, this.explorerService).then(() => {
folder.addChild(stat); folder.addChild(stat);
......
...@@ -368,4 +368,8 @@ export class ExplorerItem { ...@@ -368,4 +368,8 @@ export class ExplorerItem {
} }
} }
export class NewExplorerItem extends ExplorerItem { } export class NewExplorerItem extends ExplorerItem {
\ No newline at end of file constructor(parent: ExplorerItem, isDirectory: boolean) {
super(URI.file(''), parent, isDirectory);
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册