33 * SPDX-License-Identifier: Apache-2.0
44 */
55
6+ /* eslint-disable aws-toolkits/no-console-log */
7+
68import * as vscode from 'vscode'
79import * as CodeWhispererConstants from '../models/constants'
810import { vsCodeState , OnRecommendationAcceptanceEntry } from '../models/model'
@@ -53,6 +55,8 @@ export const acceptSuggestion = Commands.declare(
5355 traceId : TelemetryHelper . instance . traceId ,
5456 } )
5557
58+ console . log ( 'accepted completion' )
59+
5660 RecommendationService . instance . incrementAcceptedCount ( )
5761 const editor = vscode . window . activeTextEditor
5862 await Container . instance . lineAnnotationController . refresh ( editor , 'codewhisperer' )
@@ -76,10 +80,13 @@ export const acceptSuggestion = Commands.declare(
7680 * This function is called when user accepts a intelliSense suggestion or an inline suggestion
7781 */
7882export async function onInlineAcceptance ( acceptanceEntry : OnRecommendationAcceptanceEntry ) {
83+ console . log ( 'accepted inline completion' )
7984 RecommendationHandler . instance . cancelPaginatedRequest ( )
8085 RecommendationHandler . instance . disposeInlineCompletion ( )
86+ console . log ( 'accepted editor is: %O' , acceptanceEntry . editor )
8187
8288 if ( acceptanceEntry . editor ) {
89+ console . log ( 'editor was accepted' )
8390 await sleep ( CodeWhispererConstants . vsCodeCursorUpdateDelay )
8491 const languageContext = runtimeLanguageContext . getLanguageContext (
8592 acceptanceEntry . editor . document . languageId ,
@@ -106,6 +113,7 @@ export async function onInlineAcceptance(acceptanceEntry: OnRecommendationAccept
106113 } catch ( error ) {
107114 getLogger ( ) . error ( `${ error } in handling extra brackets or imports` )
108115 } finally {
116+ console . log ( 'finished editing after acceptance' )
109117 vsCodeState . isCodeWhispererEditing = false
110118 }
111119
0 commit comments