@@ -158,14 +158,12 @@ abstract class CodeGenBase {
158
158
codeGenerationId,
159
159
telemetry : telemetry ,
160
160
workspaceFolders,
161
- isCancellationRequested,
162
161
} : {
163
162
messenger : Messenger
164
163
fs : VirtualFileSystem
165
164
codeGenerationId : string
166
165
telemetry : TelemetryHelper
167
166
workspaceFolders : CurrentWsFolders
168
- isCancellationRequested ?: boolean
169
167
} ) : Promise < {
170
168
newFiles : NewFileInfo [ ]
171
169
deletedFiles : DeletedFileInfo [ ]
@@ -175,7 +173,7 @@ abstract class CodeGenBase {
175
173
} > {
176
174
for (
177
175
let pollingIteration = 0 ;
178
- pollingIteration < this . pollCount && ! isCancellationRequested ;
176
+ pollingIteration < this . pollCount && ! this . isCancellationRequested ;
179
177
++ pollingIteration
180
178
) {
181
179
const codegenResult = await this . config . proxyClient . getCodeGeneration ( this . conversationId , codeGenerationId )
@@ -260,7 +258,7 @@ abstract class CodeGenBase {
260
258
}
261
259
}
262
260
}
263
- if ( ! isCancellationRequested ) {
261
+ if ( ! this . isCancellationRequested ) {
264
262
// still in progress
265
263
const errorMessage = i18n ( 'AWS.amazonq.featureDev.error.codeGen.timeout' )
266
264
throw new ToolkitError ( errorMessage , { code : 'CodeGenTimeout' } )
@@ -320,7 +318,7 @@ export class CodeGenState extends CodeGenBase implements SessionState {
320
318
this . currentCodeGenerationId
321
319
)
322
320
323
- if ( ! action . tokenSource ?. token . isCancellationRequested ) {
321
+ if ( ! this . isCancellationRequested ) {
324
322
action . messenger . sendAnswer ( {
325
323
message : i18n ( 'AWS.amazonq.featureDev.pillText.generatingCode' ) ,
326
324
type : 'answer-part' ,
@@ -338,7 +336,6 @@ export class CodeGenState extends CodeGenBase implements SessionState {
338
336
codeGenerationId,
339
337
telemetry : action . telemetry ,
340
338
workspaceFolders : this . config . workspaceFolders ,
341
- isCancellationRequested : action . tokenSource ?. token . isCancellationRequested ,
342
339
} )
343
340
344
341
if ( codeGeneration && ! action . tokenSource ?. token . isCancellationRequested ) {
0 commit comments