mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 18:48:00 +00:00
fixes #76228
This commit is contained in:
parent
b1dd5ab40e
commit
467c80566f
|
@ -85,10 +85,15 @@ export class NewFileAction extends Action {
|
||||||
static readonly LABEL = nls.localize('createNewFile', "New File");
|
static readonly LABEL = nls.localize('createNewFile', "New File");
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@IExplorerService explorerService: IExplorerService,
|
||||||
@ICommandService private commandService: ICommandService
|
@ICommandService private commandService: ICommandService
|
||||||
) {
|
) {
|
||||||
super('explorer.newFile', NEW_FILE_LABEL);
|
super('explorer.newFile', NEW_FILE_LABEL);
|
||||||
this.class = 'explorer-action new-file';
|
this.class = 'explorer-action new-file';
|
||||||
|
this._register(explorerService.onDidChangeEditable(e => {
|
||||||
|
const elementIsBeingEdited = explorerService.isEditable(e);
|
||||||
|
this.enabled = !elementIsBeingEdited;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
run(): Promise<any> {
|
run(): Promise<any> {
|
||||||
|
@ -102,10 +107,15 @@ export class NewFolderAction extends Action {
|
||||||
static readonly LABEL = nls.localize('createNewFolder', "New Folder");
|
static readonly LABEL = nls.localize('createNewFolder', "New Folder");
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@IExplorerService explorerService: IExplorerService,
|
||||||
@ICommandService private commandService: ICommandService
|
@ICommandService private commandService: ICommandService
|
||||||
) {
|
) {
|
||||||
super('explorer.newFolder', NEW_FOLDER_LABEL);
|
super('explorer.newFolder', NEW_FOLDER_LABEL);
|
||||||
this.class = 'explorer-action new-folder';
|
this.class = 'explorer-action new-folder';
|
||||||
|
this._register(explorerService.onDidChangeEditable(e => {
|
||||||
|
const elementIsBeingEdited = explorerService.isEditable(e);
|
||||||
|
this.enabled = !elementIsBeingEdited;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
run(): Promise<any> {
|
run(): Promise<any> {
|
||||||
|
@ -599,6 +609,10 @@ export class CollapseExplorerView extends Action {
|
||||||
@IExplorerService readonly explorerService: IExplorerService
|
@IExplorerService readonly explorerService: IExplorerService
|
||||||
) {
|
) {
|
||||||
super(id, label, 'explorer-action collapse-explorer');
|
super(id, label, 'explorer-action collapse-explorer');
|
||||||
|
this._register(explorerService.onDidChangeEditable(e => {
|
||||||
|
const elementIsBeingEdited = explorerService.isEditable(e);
|
||||||
|
this.enabled = !elementIsBeingEdited;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
run(): Promise<any> {
|
run(): Promise<any> {
|
||||||
|
@ -623,6 +637,10 @@ export class RefreshExplorerView extends Action {
|
||||||
@IExplorerService private readonly explorerService: IExplorerService
|
@IExplorerService private readonly explorerService: IExplorerService
|
||||||
) {
|
) {
|
||||||
super(id, label, 'explorer-action refresh-explorer');
|
super(id, label, 'explorer-action refresh-explorer');
|
||||||
|
this._register(explorerService.onDidChangeEditable(e => {
|
||||||
|
const elementIsBeingEdited = explorerService.isEditable(e);
|
||||||
|
this.enabled = !elementIsBeingEdited;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
public run(): Promise<any> {
|
public run(): Promise<any> {
|
||||||
|
|
Loading…
Reference in a new issue