@@ -22,7 +22,7 @@ import { getPrefixSuffixOverlap } from '../util/commonUtil'
22
22
import globals from '../../shared/extensionGlobals'
23
23
import { AuthUtil } from '../util/authUtil'
24
24
25
- class CodeWhispererInlineCompletionItemProvider implements vscode . InlineCompletionItemProvider {
25
+ class CWInlineCompletionItemProvider implements vscode . InlineCompletionItemProvider {
26
26
private activeItemIndex : number | undefined
27
27
public nextMove : number
28
28
@@ -86,7 +86,7 @@ class CodeWhispererInlineCompletionItemProvider implements vscode.InlineCompleti
86
86
return index
87
87
}
88
88
89
- truncateSuggestionOverlapWithRightContext ( document : vscode . TextDocument , suggestion : string ) : string {
89
+ truncateOverlapWithRightContext ( document : vscode . TextDocument , suggestion : string ) : string {
90
90
let rightContextRange : vscode . Range | undefined = undefined
91
91
const pos = RecommendationHandler . instance . startPos
92
92
if ( suggestion . split ( / \r ? \n / ) . length > 1 ) {
@@ -110,7 +110,7 @@ class CodeWhispererInlineCompletionItemProvider implements vscode.InlineCompleti
110
110
if ( ! r . content . startsWith ( prefix ) ) {
111
111
return undefined
112
112
}
113
- const truncatedSuggestion = this . truncateSuggestionOverlapWithRightContext ( document , r . content )
113
+ const truncatedSuggestion = this . truncateOverlapWithRightContext ( document , r . content )
114
114
if ( truncatedSuggestion . length === 0 ) {
115
115
if ( RecommendationHandler . instance . getSuggestionState ( index ) !== 'Showed' ) {
116
116
RecommendationHandler . instance . setSuggestionState ( index , 'Discard' )
@@ -210,7 +210,7 @@ const hideCommand = Commands.declare(
210
210
)
211
211
212
212
export class InlineCompletionService {
213
- private inlineCompletionProvider ?: CodeWhispererInlineCompletionItemProvider
213
+ private inlineCompletionProvider ?: CWInlineCompletionItemProvider
214
214
private inlineCompletionProviderDisposable ?: vscode . Disposable
215
215
private maxPage = 100
216
216
private statusBar : vscode . StatusBarItem = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left , 1 )
@@ -289,7 +289,7 @@ export class InlineCompletionService {
289
289
vsCodeState . isCodeWhispererEditing = false
290
290
ReferenceInlineProvider . instance . removeInlineReference ( )
291
291
RecommendationHandler . instance . cancelPaginatedRequest ( )
292
- RecommendationHandler . instance . reportUserDecisionOfCurrentRecommendation ( editor , - 1 )
292
+ RecommendationHandler . instance . reportUserDecisionOfRecommendation ( editor , - 1 )
293
293
RecommendationHandler . instance . clearRecommendations ( )
294
294
this . disposeInlineCompletion ( )
295
295
this . setCodeWhispererStatusBarOk ( )
@@ -312,7 +312,7 @@ export class InlineCompletionService {
312
312
RecommendationHandler . instance . recommendations . forEach ( ( r , i ) => {
313
313
RecommendationHandler . instance . setSuggestionState ( i , 'Discard' )
314
314
} )
315
- RecommendationHandler . instance . reportUserDecisionOfCurrentRecommendation ( editor , - 1 )
315
+ RecommendationHandler . instance . reportUserDecisionOfRecommendation ( editor , - 1 )
316
316
RecommendationHandler . instance . clearRecommendations ( )
317
317
} else if ( RecommendationHandler . instance . recommendations . length > 0 ) {
318
318
RecommendationHandler . instance . moveStartPositionToSkipSpaces ( editor )
@@ -349,7 +349,7 @@ export class InlineCompletionService {
349
349
page
350
350
)
351
351
if ( RecommendationHandler . instance . checkAndResetCancellationTokens ( ) ) {
352
- RecommendationHandler . instance . reportUserDecisionOfCurrentRecommendation ( editor , - 1 )
352
+ RecommendationHandler . instance . reportUserDecisionOfRecommendation ( editor , - 1 )
353
353
RecommendationHandler . instance . clearRecommendations ( )
354
354
this . setCodeWhispererStatusBarOk ( )
355
355
return
@@ -377,7 +377,7 @@ export class InlineCompletionService {
377
377
if ( vscode . window . activeTextEditor ) {
378
378
vscode . window . showTextDocument ( vscode . window . activeTextEditor . document )
379
379
}
380
- this . inlineCompletionProvider = new CodeWhispererInlineCompletionItemProvider (
380
+ this . inlineCompletionProvider = new CWInlineCompletionItemProvider (
381
381
this . inlineCompletionProvider ?. getActiveItemIndex ,
382
382
indexShift
383
383
)
0 commit comments