Skip to content

Commit

Permalink
Cleanup from #183481
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed May 26, 2023
1 parent 56a0248 commit 633c5d1
Showing 1 changed file with 2 additions and 31 deletions.
33 changes: 2 additions & 31 deletions src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const getMoveToEditorChatActionDescriptorForViewTitle = (viewId: string, provide
viewId,
menu: {
id: MenuId.ViewTitle,
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', viewId)),
when: ContextKeyExpr.equals('view', viewId),
order: 0
},
});
Expand All @@ -56,35 +56,6 @@ export function getMoveToEditorAction(viewId: string, providerId: string) {
};
}

const getMoveToSidebarChatActionDescriptorForViewTitle = (viewId: string, providerId: string): Readonly<IAction2Options> & { viewId: string } => ({
id: `workbench.action.chat.${providerId}.openInSidebar`,
title: {
value: localize('chat.openInSidebar.label', "Open In Sidebar"),
original: 'Open In Sidebar'
},
category: CHAT_CATEGORY,
precondition: CONTEXT_PROVIDER_EXISTS,
f1: false,
viewId,
menu: [{
id: MenuId.EditorTitle,
order: 0,
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
}]
});

export function getMoveToSidebarAction(viewId: string, providerId: string) {
return class MoveToSidebarAction extends Action2 {
constructor() {
super(getMoveToSidebarChatActionDescriptorForViewTitle(viewId, providerId));
}

override async run(accessor: ServicesAccessor, ...args: any[]) {
return moveToSidebar(accessor);
}
};
}

async function moveToSidebar(accessor: ServicesAccessor): Promise<void> {
const viewsService = accessor.get(IViewsService);
const editorService = accessor.get(IEditorService);
Expand Down Expand Up @@ -151,7 +122,7 @@ export function registerMoveActions() {
menu: [{
id: MenuId.EditorTitle,
order: 0,
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
when: ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID),
}]
});
}
Expand Down

0 comments on commit 633c5d1

Please sign in to comment.