@@ -258,9 +258,11 @@ export class InlineCompletionsModel extends Disposable {
258
258
public stop ( stopReason : 'explicitCancel' | 'automatic' = 'automatic' , tx ?: ITransaction ) : void {
259
259
subtransaction ( tx , tx => {
260
260
if ( stopReason === 'explicitCancel' ) {
261
- const completion = this . state . get ( ) ?. inlineCompletion ?. inlineCompletion ;
262
- if ( completion && completion . source . provider . handleRejection ) {
263
- completion . source . provider . handleRejection ( completion . source . inlineCompletions , completion . sourceInlineCompletion ) ;
261
+ const inlineCompletion = this . state . get ( ) ?. inlineCompletion ;
262
+ const source = inlineCompletion ?. source ;
263
+ const sourceInlineCompletion = inlineCompletion ?. sourceInlineCompletion ;
264
+ if ( sourceInlineCompletion && source ?. provider . handleRejection ) {
265
+ source . provider . handleRejection ( source . inlineCompletions , sourceInlineCompletion ) ;
264
266
}
265
267
}
266
268
@@ -284,7 +286,7 @@ export class InlineCompletionsModel extends Disposable {
284
286
let inlineEdit : InlineCompletionWithUpdatedRange | undefined = undefined ;
285
287
const visibleCompletions : InlineCompletionWithUpdatedRange [ ] = [ ] ;
286
288
for ( const completion of c . inlineCompletions ) {
287
- if ( ! completion . inlineCompletion . sourceInlineCompletion . isInlineEdit ) {
289
+ if ( ! completion . sourceInlineCompletion . isInlineEdit ) {
288
290
if ( completion . isVisible ( this . textModel , cursorPosition , reader ) ) {
289
291
visibleCompletions . push ( completion ) ;
290
292
}
@@ -329,7 +331,7 @@ export class InlineCompletionsModel extends Disposable {
329
331
} ) ;
330
332
331
333
public readonly activeCommands = derivedOpts < Command [ ] > ( { owner : this , equalsFn : itemsEquals ( ) } ,
332
- r => this . selectedInlineCompletion . read ( r ) ?. inlineCompletion . source . inlineCompletions . commands ?? [ ]
334
+ r => this . selectedInlineCompletion . read ( r ) ?. source . inlineCompletions . commands ?? [ ]
333
335
) ;
334
336
335
337
public readonly lastTriggerKind : IObservable < InlineCompletionTriggerKind | undefined >
@@ -745,10 +747,11 @@ export class InlineCompletionsModel extends Disposable {
745
747
const augmentedCompletion = this . _computeAugmentation ( itemEdit , undefined ) ;
746
748
if ( ! augmentedCompletion ) { return ; }
747
749
748
- const inlineCompletion = augmentedCompletion . completion . inlineCompletion ;
749
- inlineCompletion . source . provider . handlePartialAccept ?.(
750
- inlineCompletion . source . inlineCompletions ,
751
- inlineCompletion . sourceInlineCompletion ,
750
+ const source = augmentedCompletion . completion . source ;
751
+ const sourceInlineCompletion = augmentedCompletion . completion . sourceInlineCompletion ;
752
+ source . provider . handlePartialAccept ?.(
753
+ source . inlineCompletions ,
754
+ sourceInlineCompletion ,
752
755
itemEdit . text . length ,
753
756
{
754
757
kind : PartialAcceptTriggerKind . Suggest ,
0 commit comments