mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 12:40:19 -05:00
@@ -127,7 +127,7 @@ export class StartAction extends AbstractDebugAction {
|
||||
}
|
||||
|
||||
public run(): TPromise<any> {
|
||||
return this.commandService.executeCommand('workbench.action.files.saveIfDirty').then(() => {
|
||||
return this.commandService.executeCommand('workbench.action.files.saveAll').then(() => {
|
||||
if (this.debugService.getModel().getProcesses().length === 0) {
|
||||
this.debugService.removeReplExpressions();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { ActionItem, BaseActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry';
|
||||
import { IEditorInputActionContext, IEditorInputAction, EditorInputActionContributor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { GlobalNewUntitledFileAction, SaveFileAsAction, SaveIfDirtyFileAction, OpenFileAction, ShowOpenedFileInNewWindow, CopyPathAction, GlobalCopyPathAction, RevealInOSAction, GlobalRevealInOSAction, pasteIntoFocusedFilesExplorerViewItem, FocusOpenEditorsView, FocusFilesExplorer, GlobalCompareResourcesAction, GlobalNewFileAction, GlobalNewFolderAction, RevertFileAction, SaveFilesAction, SaveAllAction, SaveFileAction, keybindingForAction, MoveFileToTrashAction, TriggerRenameFileAction, PasteFileAction, CopyFileAction, SelectResourceForCompareAction, CompareResourcesAction, NewFolderAction, NewFileAction, OpenToSideAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView } from 'vs/workbench/parts/files/browser/fileActions';
|
||||
import { GlobalNewUntitledFileAction, SaveFileAsAction, OpenFileAction, ShowOpenedFileInNewWindow, CopyPathAction, GlobalCopyPathAction, RevealInOSAction, GlobalRevealInOSAction, pasteIntoFocusedFilesExplorerViewItem, FocusOpenEditorsView, FocusFilesExplorer, GlobalCompareResourcesAction, GlobalNewFileAction, GlobalNewFolderAction, RevertFileAction, SaveFilesAction, SaveAllAction, SaveFileAction, keybindingForAction, MoveFileToTrashAction, TriggerRenameFileAction, PasteFileAction, CopyFileAction, SelectResourceForCompareAction, CompareResourcesAction, NewFolderAction, NewFileAction, OpenToSideAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView } from 'vs/workbench/parts/files/browser/fileActions';
|
||||
import { RevertLocalChangesAction, AcceptLocalChangesAction, CONFLICT_RESOLUTION_SCHEME } from 'vs/workbench/parts/files/browser/saveErrorHandler';
|
||||
import { SyncActionDescriptor, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry';
|
||||
@@ -223,7 +223,6 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(ShowActiveFileInExplor
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(CollapseExplorerView, CollapseExplorerView.ID, CollapseExplorerView.LABEL), 'Files: Collapse Folders in Explorer', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(RefreshExplorerView, RefreshExplorerView.ID, RefreshExplorerView.LABEL), 'Files: Refresh Explorer', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(SaveFileAsAction, SaveFileAsAction.ID, SaveFileAsAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_S }), 'Files: Save As...', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(SaveIfDirtyFileAction, SaveIfDirtyFileAction.ID, SaveIfDirtyFileAction.LABEL), 'Files: Save If Dirty', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(GlobalNewUntitledFileAction, GlobalNewUntitledFileAction.ID, GlobalNewUntitledFileAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_N }), 'Files: New Untitled File', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(GlobalRevealInOSAction, GlobalRevealInOSAction.ID, GlobalRevealInOSAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_R) }), 'Files: Reveal Active File', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(ShowOpenedFileInNewWindow, ShowOpenedFileInNewWindow.ID, ShowOpenedFileInNewWindow.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_O) }), 'Files: Open Active File in New Window', category);
|
||||
|
||||
@@ -1423,26 +1423,11 @@ export abstract class BaseSaveFileAction extends BaseActionWithErrorReporting {
|
||||
}
|
||||
|
||||
// Just save
|
||||
return this.textFileService.save(source, { force: this.isForce() /* force a change to the file to trigger external watchers if any */ });
|
||||
return this.textFileService.save(source, { force: true /* force a change to the file to trigger external watchers if any */ });
|
||||
}
|
||||
|
||||
return TPromise.as(false);
|
||||
}
|
||||
|
||||
protected abstract isForce(): boolean;
|
||||
}
|
||||
|
||||
export class SaveIfDirtyFileAction extends BaseSaveFileAction {
|
||||
public static ID = 'workbench.action.files.saveIfDirty';
|
||||
public static LABEL = nls.localize('saveIfDirty', "Save If Dirty");
|
||||
|
||||
public isSaveAs(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected isForce(): boolean {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export class SaveFileAction extends BaseSaveFileAction {
|
||||
@@ -1453,10 +1438,6 @@ export class SaveFileAction extends BaseSaveFileAction {
|
||||
public isSaveAs(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected isForce(): boolean {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export class SaveFileAsAction extends BaseSaveFileAction {
|
||||
@@ -1467,10 +1448,6 @@ export class SaveFileAsAction extends BaseSaveFileAction {
|
||||
public isSaveAs(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected isForce(): boolean {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class BaseSaveAllAction extends BaseActionWithErrorReporting {
|
||||
|
||||
Reference in New Issue
Block a user