@@ -177,7 +177,6 @@ export async function activate(context: ExtContext): Promise<void> {
177
177
return
178
178
}
179
179
RecommendationHandler . instance . reportUserDecisionOfRecommendation ( vscode . window . activeTextEditor , - 1 )
180
- RecommendationHandler . instance . clearRecommendations ( )
181
180
} ) ,
182
181
183
182
vscode . languages . registerHoverProvider (
@@ -251,13 +250,13 @@ export async function activate(context: ExtContext): Promise<void> {
251
250
*/
252
251
context . extensionContext . subscriptions . push (
253
252
vscode . window . onDidChangeActiveTextEditor ( async editor => {
254
- await InlineCompletionService . instance . onEditorChange ( )
253
+ await RecommendationHandler . instance . onEditorChange ( )
255
254
} ) ,
256
255
vscode . window . onDidChangeWindowState ( async e => {
257
- await InlineCompletionService . instance . onFocusChange ( )
256
+ await RecommendationHandler . instance . onFocusChange ( )
258
257
} ) ,
259
258
vscode . window . onDidChangeTextEditorSelection ( async e => {
260
- await InlineCompletionService . instance . onCursorChange ( e )
259
+ await RecommendationHandler . instance . onCursorChange ( e )
261
260
} ) ,
262
261
vscode . workspace . onDidChangeTextDocument ( async e => {
263
262
/**
@@ -266,6 +265,9 @@ export async function activate(context: ExtContext): Promise<void> {
266
265
if ( e . document === vscode . window . activeTextEditor ?. document ) {
267
266
disposeSecurityDiagnostic ( e )
268
267
}
268
+
269
+ CodeWhispererCodeCoverageTracker . getTracker ( e . document . languageId ) ?. countTotalTokens ( e )
270
+
269
271
/**
270
272
* Handle this keystroke event only when
271
273
* 1. It is in current non plaintext active editor
@@ -292,7 +294,7 @@ export async function activate(context: ExtContext): Promise<void> {
292
294
* Then this event can be processed by our code.
293
295
*/
294
296
await sleep ( CodeWhispererConstants . vsCodeCursorUpdateDelay )
295
- if ( ! InlineCompletionService . instance . isSuggestionVisible ( ) ) {
297
+ if ( ! RecommendationHandler . instance . isSuggestionVisible ( ) ) {
296
298
await KeyStrokeHandler . instance . processKeyStroke (
297
299
e ,
298
300
vscode . window . activeTextEditor ,
@@ -387,13 +389,7 @@ export async function activate(context: ExtContext): Promise<void> {
387
389
}
388
390
389
391
export async function shutdown ( ) {
390
- if ( isCloud9 ( ) ) {
391
- RecommendationHandler . instance . reportUserDecisionOfRecommendation ( vscode . window . activeTextEditor , - 1 )
392
- RecommendationHandler . instance . clearRecommendations ( )
393
- }
394
- if ( isInlineCompletionEnabled ( ) ) {
395
- await InlineCompletionService . instance . clearInlineCompletionStates ( vscode . window . activeTextEditor )
396
- }
392
+ RecommendationHandler . instance . reportUserDecisionOfRecommendation ( vscode . window . activeTextEditor , - 1 )
397
393
CodeWhispererTracker . getTracker ( ) . shutdown ( )
398
394
}
399
395
0 commit comments