Skip to content

Commit 2d7fc6f

Browse files
authored
fix: reverts for keyboard shortcuts feature (#7676)
## Problem Revert PR shortcut ## Solution --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 276f9ef commit 2d7fc6f

File tree

5 files changed

+2
-64
lines changed

5 files changed

+2
-64
lines changed

packages/amazonq/package.json

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -560,21 +560,6 @@
560560
]
561561
},
562562
"commands": [
563-
{
564-
"command": "aws.amazonq.stopCmdExecution",
565-
"title": "Stop Amazon Q Command Execution",
566-
"category": "%AWS.amazonq.title%"
567-
},
568-
{
569-
"command": "aws.amazonq.runCmdExecution",
570-
"title": "Run Amazon Q Command Execution",
571-
"category": "%AWS.amazonq.title%"
572-
},
573-
{
574-
"command": "aws.amazonq.rejectCmdExecution",
575-
"title": "Reject Amazon Q Command Execution",
576-
"category": "%AWS.amazonq.title%"
577-
},
578563
{
579564
"command": "_aws.amazonq.notifications.dismiss",
580565
"title": "%AWS.generic.dismiss%",
@@ -865,24 +850,6 @@
865850
}
866851
],
867852
"keybindings": [
868-
{
869-
"command": "aws.amazonq.stopCmdExecution",
870-
"key": "ctrl+shift+backspace",
871-
"mac": "cmd+shift+backspace",
872-
"when": "aws.amazonq.amazonqChatLSP.isRunning"
873-
},
874-
{
875-
"command": "aws.amazonq.runCmdExecution",
876-
"key": "ctrl+shift+enter",
877-
"mac": "cmd+shift+enter",
878-
"when": "aws.amazonq.amazonqChatLSP.isRunning"
879-
},
880-
{
881-
"command": "aws.amazonq.rejectCmdExecution",
882-
"key": "ctrl+shift+r",
883-
"mac": "cmd+shift+r",
884-
"when": "aws.amazonq.amazonqChatLSP.isRunning"
885-
},
886853
{
887854
"command": "_aws.amazonq.focusChat.keybinding",
888855
"win": "win+alt+i",

packages/amazonq/src/lsp/chat/commands.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ export function registerCommands(provider: AmazonQChatViewProvider) {
5959
params: {},
6060
})
6161
})
62-
}),
63-
registerShellCommandShortCut('aws.amazonq.runCmdExecution', 'run-shell-command', provider),
64-
registerShellCommandShortCut('aws.amazonq.rejectCmdExecution', 'reject-shell-command', provider),
65-
registerShellCommandShortCut('aws.amazonq.stopCmdExecution', 'stop-shell-command', provider)
62+
})
6663
)
6764
}
6865

@@ -159,14 +156,3 @@ export async function focusAmazonQPanel() {
159156
await Commands.tryExecute('aws.amazonq.AmazonQChatView.focus')
160157
await Commands.tryExecute('aws.amazonq.AmazonCommonAuth.focus')
161158
}
162-
163-
function registerShellCommandShortCut(commandName: string, buttonId: string, provider: AmazonQChatViewProvider) {
164-
return Commands.register(commandName, async () => {
165-
void focusAmazonQPanel().then(() => {
166-
void provider.webview?.postMessage({
167-
command: 'aws/chat/executeShellCommandShortCut',
168-
params: { id: buttonId },
169-
})
170-
})
171-
})
172-
}

packages/amazonq/src/lsp/chat/webviewProvider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
Webview,
1414
} from 'vscode'
1515
import * as path from 'path'
16-
import * as os from 'os'
1716
import {
1817
globals,
1918
isSageMaker,
@@ -150,7 +149,7 @@ export class AmazonQChatViewProvider implements WebviewViewProvider {
150149
const vscodeApi = acquireVsCodeApi()
151150
const hybridChatConnector = new HybridChatAdapter(${(await AuthUtil.instance.getChatAuthState()).amazonQ === 'connected'},${featureConfigData},${welcomeCount},${disclaimerAcknowledged},${regionProfileString},${disabledCommands},${isSMUS},${isSM},vscodeApi.postMessage)
152151
const commands = [hybridChatConnector.initialQuickActions[0]]
153-
qChat = amazonQChat.createChat(vscodeApi, {os: "${os.platform()}", disclaimerAcknowledged: ${disclaimerAcknowledged}, pairProgrammingAcknowledged: ${pairProgrammingAcknowledged}, agenticMode: true, quickActionCommands: commands, modelSelectionEnabled: ${modelSelectionEnabled}}, hybridChatConnector, ${JSON.stringify(featureConfigData)});
152+
qChat = amazonQChat.createChat(vscodeApi, {disclaimerAcknowledged: ${disclaimerAcknowledged}, pairProgrammingAcknowledged: ${pairProgrammingAcknowledged}, agenticMode: true, quickActionCommands: commands, modelSelectionEnabled: ${modelSelectionEnabled}}, hybridChatConnector, ${JSON.stringify(featureConfigData)});
154153
}
155154
window.addEventListener('message', (event) => {
156155
/**

packages/amazonq/src/lsp/client.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import {
3939
getClientId,
4040
extensionVersion,
4141
isSageMaker,
42-
setContext,
4342
} from 'aws-core-vscode/shared'
4443
import { processUtils } from 'aws-core-vscode/shared'
4544
import { activate } from './chat/activation'
@@ -166,7 +165,6 @@ export async function startLanguageServer(
166165
pinnedContextEnabled: true,
167166
imageContextEnabled: true,
168167
mcp: true,
169-
shortcut: true,
170168
reroute: true,
171169
modelSelection: true,
172170
workspaceFilePath: vscode.workspace.workspaceFile?.fsPath,
@@ -278,17 +276,6 @@ async function onLanguageServerReady(
278276

279277
if (Experiments.instance.get('amazonqChatLSP', true)) {
280278
await activate(client, encryptionKey, resourcePaths.ui)
281-
282-
await setContext('aws.amazonq.amazonqChatLSP.isRunning', true)
283-
getLogger().info('Amazon Q Chat LSP context flag set on client activated')
284-
285-
// Add a disposable to reset the context flag when the client stops
286-
toDispose.push({
287-
dispose: async () => {
288-
await setContext('aws.amazonq.amazonqChatLSP.isRunning', false)
289-
getLogger().info('Amazon Q Chat LSP context flag reset on client disposal')
290-
},
291-
})
292279
}
293280

294281
const refreshInterval = auth.startTokenRefreshInterval(10 * oneSecond)

packages/core/src/shared/vscode/setContext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export type contextKey =
4040
| 'gumby.wasQCodeTransformationUsed'
4141
| 'amazonq.inline.codelensShortcutEnabled'
4242
| 'aws.toolkit.lambda.walkthroughSelected'
43-
| 'aws.amazonq.amazonqChatLSP.isRunning'
4443

4544
const contextMap: Partial<Record<contextKey, any>> = {}
4645

0 commit comments

Comments
 (0)