Add API to force quit with the ability to revert changes silently#21593
Add API to force quit with the ability to revert changes silently#21593bpasero merged 4 commits intomicrosoft:masterfrom
Conversation
|
@misoguy, |
bpasero
left a comment
There was a problem hiding this comment.
Thanks much better, added some minor feedback.
|
|
||
| export class ForceCloseEditorAction extends Action { | ||
|
|
||
| public static ID = 'workbench.action.forceCloseActiveEditor'; |
There was a problem hiding this comment.
Maybe better workbench.action.revertAndCloseActiveEditor ?
| } | ||
| } | ||
|
|
||
| export class ForceCloseEditorAction extends Action { |
There was a problem hiding this comment.
Suggest to move this into editorActions.ts
There was a problem hiding this comment.
I have added a commit to move this into vs/workbench/browser/parts/editor/editorActions.ts.
I have previously added it into vs/workbench/electron-browser/actions.ts
because i found the command "workbench.action.closeActiveEditor" to be at 2 files (actions.ts & editorActions.ts) and it seemed like main.contribution.ts was importing the CloseEditorAction from the one in vs/workbench/electron-browser/actions.ts.
It'd be nice if you could briefly explain the difference between the two files(actions.ts & editorActions.ts) with the same command "workbench.action.closeActiveEditor"
| export class ForceCloseEditorAction extends Action { | ||
|
|
||
| public static ID = 'workbench.action.forceCloseActiveEditor'; | ||
| public static LABEL = nls.localize('forceCloseActiveEditor', "Force Close Editor"); |
|
Thanks 👍 |
|
Did this API ever get added (workbench.action.forceCloseActiveEditor, or with another action name)? I do not see this documented. I've been looking for a way to close the active editor and not prompt the user to save. I thought about creating another feature request issue to ask for the ability to save the activeEditor as a URI provided by an extension. For example: workbench.action.saveActiveEditorAsURI, in which the URI is provided as an argument. The key here is I do not want the user to provide the file location. Does this request exist or shall I create one? |
Fix #21536
Adds "workbench.action.forceCloseActiveEditor" to externalAPI