Skip to content

Commit

Permalink
Do not show sparkle button or insert at cursor on bash code blocks (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Aug 30, 2024
1 parent 72e9b7d commit 7e5c07f
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ import { InlineChatController } from '../../../inlineChat/browser/inlineChatCont
import { coalesce } from '../../../../../base/common/arrays.js';
import { AsyncIterableObject } from '../../../../../base/common/async.js';

const shellLangIds = [
'fish',
'ps1',
'pwsh',
'powershell',
'sh',
'shellscript',
'zsh'
];

export interface IChatCodeBlockActionContext extends ICodeBlockActionContext {
element: IChatResponseViewModel;
}
Expand Down Expand Up @@ -409,7 +419,10 @@ export function registerChatCodeBlockActions() {
menu: {
id: MenuId.ChatCodeBlock,
group: 'navigation',
when: CONTEXT_IN_CHAT_SESSION,
when: ContextKeyExpr.and(
CONTEXT_IN_CHAT_SESSION,
...shellLangIds.map(e => ContextKeyExpr.notEquals(EditorContextKeys.languageId.key, e))
),
order: 10
},
keybinding: {
Expand Down Expand Up @@ -566,15 +579,6 @@ export function registerChatCodeBlockActions() {
}
});

const shellLangIds = [
'fish',
'ps1',
'pwsh',
'powershell',
'sh',
'shellscript',
'zsh'
];
registerAction2(class RunInTerminalAction extends ChatCodeBlockAction {
constructor() {
super({
Expand Down

0 comments on commit 7e5c07f

Please sign in to comment.