Skip to content

Commit 038dd0c

Browse files
authored
telemetry: register onacceptance command (#8010)
## Problem ## 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 77676b3 commit 038dd0c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

packages/amazonq/src/app/inline/activation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import vscode from 'vscode'
77
import {
8+
acceptSuggestion,
89
AuthUtil,
910
CodeSuggestionsState,
1011
CodeWhispererCodeCoverageTracker,
@@ -61,6 +62,7 @@ export async function activate(languageClient: LanguageClient) {
6162
* Automated trigger
6263
*/
6364
globals.context.subscriptions.push(
65+
acceptSuggestion.register(globals.context),
6466
vscode.window.onDidChangeActiveTextEditor(async (editor) => {
6567
await RecommendationHandler.instance.onEditorChange()
6668
}),

packages/core/src/codewhisperer/commands/onInlineAcceptance.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { sleep } from '../../shared/utilities/timeoutUtils'
1515
import { handleExtraBrackets } from '../util/closingBracketUtil'
1616
import { Commands } from '../../shared/vscode/commands2'
1717
import { isInlineCompletionEnabled } from '../util/commonUtil'
18-
import { ExtContext } from '../../shared/extensions'
1918
import { onAcceptance } from './onAcceptance'
2019
import * as codewhispererClient from '../client/codewhisperer'
2120
import {
@@ -36,7 +35,7 @@ import { UserWrittenCodeTracker } from '../tracker/userWrittenCodeTracker'
3635

3736
export const acceptSuggestion = Commands.declare(
3837
'aws.amazonq.accept',
39-
(context: ExtContext) =>
38+
(context: vscode.ExtensionContext) =>
4039
async (
4140
range: vscode.Range,
4241
effectiveRange: vscode.Range,

packages/core/src/codewhisperer/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export { TelemetryHelper } from './util/telemetryHelper'
6262
export { LineSelection, LineTracker } from './tracker/lineTracker'
6363
export { runtimeLanguageContext, RuntimeLanguageContext } from './util/runtimeLanguageContext'
6464
export * as startSecurityScan from './commands/startSecurityScan'
65+
export { acceptSuggestion } from './commands/onInlineAcceptance'
6566
export * from './util/showSsoPrompt'
6667
export * from './util/securityScanLanguageContext'
6768
export * from './util/importAdderUtil'

0 commit comments

Comments
 (0)