提交 1134b213 编写于 作者: J Joao Moreno

fixes #69368

上级 1afeb46c
......@@ -42,7 +42,7 @@ import { Constants } from 'vs/editor/common/core/uint';
import { CLOSE_EDITORS_AND_GROUP_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands';
import { coalesce } from 'vs/base/common/arrays';
import { AsyncDataTree } from 'vs/base/browser/ui/tree/asyncDataTree';
import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel';
import { ExplorerItem, NewExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel';
import { onUnexpectedError } from 'vs/base/common/errors';
import { sequence } from 'vs/base/common/async';
......@@ -137,7 +137,7 @@ export class NewFileAction extends BaseErrorReportingAction {
return Promise.reject(new Error('Parent folder is readonly.'));
}
const stat = new ExplorerItem(PLACEHOLDER_URI, folder, false);
const stat = new NewExplorerItem(PLACEHOLDER_URI, folder, false);
return folder.fetchChildren(this.fileService, this.explorerService).then(() => {
folder.addChild(stat);
......@@ -205,7 +205,7 @@ export class NewFolderAction extends BaseErrorReportingAction {
return Promise.reject(new Error('Parent folder is readonly.'));
}
const stat = new ExplorerItem(PLACEHOLDER_URI, folder, true);
const stat = new NewExplorerItem(PLACEHOLDER_URI, folder, true);
return folder.fetchChildren(this.fileService, this.explorerService).then(() => {
folder.addChild(stat);
......
......@@ -37,7 +37,7 @@ import { ITreeContextMenuEvent } from 'vs/base/browser/ui/tree/tree';
import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions';
import { fillInContextMenuActions } from 'vs/platform/actions/browser/menuItemActionItem';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel';
import { ExplorerItem, NewExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel';
import { onUnexpectedError } from 'vs/base/common/errors';
import { ResourceLabels, IResourceLabelsContainer } from 'vs/workbench/browser/labels';
import { createFileIconThemableTreeContainerScope } from 'vs/workbench/browser/parts/views/views';
......@@ -281,7 +281,13 @@ export class ExplorerView extends ViewletPanel {
accessibilityProvider: new ExplorerAccessibilityProvider(),
ariaLabel: nls.localize('treeAriaLabel', "Files Explorer"),
identityProvider: {
getId: (stat: ExplorerItem) => stat.resource
getId: (stat: ExplorerItem) => {
if (stat instanceof NewExplorerItem) {
return `new:${stat.resource}`;
}
return stat.resource;
}
},
keyboardNavigationLabelProvider: {
getKeyboardNavigationLabel: (stat: ExplorerItem) => {
......
......@@ -367,3 +367,5 @@ export class ExplorerItem {
return null;
}
}
export class NewExplorerItem extends ExplorerItem { }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册