-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
explorer: initial actions to commands transition #40168
Conversation
|
||
export function setup(): void { | ||
registerActiveEditorMoveCommand(); | ||
registerDiffEditorCommands(); | ||
registerOpenEditorAtIndexCommands(); | ||
registerExplorerCommands(); |
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.
@isidorn I would not call this explorer commands for layering reasons (explorer is a contribution to the workbench, and editor is not). Just call them editor commands or similar.
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.
Make sense, I will change it.
src/vs/workbench/common/editor.ts
Outdated
@@ -789,6 +789,7 @@ export interface IEditorIdentifier { | |||
|
|||
export interface IEditorContext extends IEditorIdentifier { | |||
event?: any; | |||
resource?: URI; |
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.
@isidorn would it not be enough to call editorinput.getResource()
? Every editor now has this method so you can get the resource from there.
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.
@bpasero notice that in some actions I only have a resource
and then I have to pass them on to the command somehow without having the editor.
Currently I do
return this.commandService.executeCommand(OPEN_TO_SIDE_COMMAND_ID, { resource: this.resource });
An ugly alternative is
return this.commandService.executeCommand(OPEN_TO_SIDE_COMMAND_ID, { editor: { getResource: () => this.resource }});
…mand registration
@isidorn feedback as discussed:
Debt to think about: currently we seem to register commands not from |
@bpasero I checked and the So it would be nice to have the same name, however not sure how then to fix the ordering problem. |
@isidorn we could maybe bring back that group and a) for the open editors make it the primary group and b) for the explorer make it the secondary one so that the group for "New" wins over it. |
fyi @bpasero I am wrapping this up and will probably merge into master later today / tomorrow morning There are still some minor issues but I will treat them as bugs and fix as we go. |
I have merged in this PR, I have created #40909 and #40910 as follow up items. Could not fix the terminal issue since the terminal is not working on my out of source due to unrelated reasons. |
fixes #24900
This is work in progress, currently I am simply transitioning a couple of actions into commands.
fyi @bpasero