-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Add API to force quit with the ability to revert changes silently #21593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@misoguy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks much better, added some minor feedback.
@@ -59,6 +59,31 @@ export class CloseEditorAction extends Action { | |||
} | |||
} | |||
|
|||
export class ForceCloseEditorAction extends Action { | |||
|
|||
public static ID = 'workbench.action.forceCloseActiveEditor'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better workbench.action.revertAndCloseActiveEditor
?
@@ -59,6 +59,31 @@ export class CloseEditorAction extends Action { | |||
} | |||
} | |||
|
|||
export class ForceCloseEditorAction extends Action { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to move this into editorActions.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert and 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