Skip to content

Commit 2eb6cb7

Browse files
authored
fix(codewhisperer): left/right keybinding conflicts with other plugins #2942
Update `CODEWHISPERER_ENABLED` after accepting ToS ref #2939
1 parent 28f71b4 commit 2eb6cb7

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "CodeWhisperer left/right arrow keybinding conflict with other plugins"
4+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2989,12 +2989,12 @@
29892989
{
29902990
"key": "right",
29912991
"command": "editor.action.inlineSuggest.showNext",
2992-
"when": "inlineSuggestionVisible && !editorReadonly"
2992+
"when": "inlineSuggestionVisible && !editorReadonly && CODEWHISPERER_ENABLED"
29932993
},
29942994
{
29952995
"key": "left",
29962996
"command": "editor.action.inlineSuggest.showPrevious",
2997-
"when": "inlineSuggestionVisible && !editorReadonly"
2997+
"when": "inlineSuggestionVisible && !editorReadonly && CODEWHISPERER_ENABLED"
29982998
}
29992999
],
30003000
"grammars": [

src/codewhisperer/activation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export async function activate(context: ExtContext): Promise<void> {
121121
await set(CodeWhispererConstants.autoTriggerEnabledKey, true, context.extensionContext.globalState)
122122
await set(CodeWhispererConstants.termsAcceptedKey, true, context.extensionContext.globalState)
123123
await vscode.commands.executeCommand('setContext', CodeWhispererConstants.termsAcceptedKey, true)
124+
await vscode.commands.executeCommand('setContext', 'CODEWHISPERER_ENABLED', true)
124125
await vscode.commands.executeCommand('aws.codeWhisperer.refresh')
125126

126127
const isShow = get(CodeWhispererConstants.welcomeMessageKey, context.extensionContext.globalState)
@@ -262,6 +263,7 @@ export async function activate(context: ExtContext): Promise<void> {
262263
updateCloud9TreeNodes.execute()
263264
} else if (isInlineCompletionEnabled()) {
264265
await setSubscriptionsforInlineCompletion()
266+
await vscode.commands.executeCommand('setContext', 'CODEWHISPERER_ENABLED', await getManualTriggerStatus())
265267
} else {
266268
await setSubscriptionsforVsCodeInline()
267269
}

0 commit comments

Comments
 (0)