Skip to content

Commit 24ff1af

Browse files
committed
fix(dev): apply fixes based on new eslint rules
1 parent 97cf9c0 commit 24ff1af

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/core/src/amazonqFeatureDev/session/session.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ export class Session {
135135

136136
if (resp.nextState) {
137137
// Cancel the request before moving to a new state
138-
if (!this.state?.tokenSource?.token.isCancellationRequested) this.state?.tokenSource?.cancel()
138+
if (!this.state?.tokenSource?.token.isCancellationRequested) {
139+
this.state?.tokenSource?.cancel()
140+
}
139141

140142
// Move to the next state
141143
this._state = resp.nextState

packages/core/src/amazonqFeatureDev/session/sessionState.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { collectFiles, getWorkspaceFoldersByPrefixes } from '../../shared/utilit
3939
import { i18n } from '../../shared/i18n-helper'
4040
import { Messenger } from '../controllers/chat/messenger/messenger'
4141

42-
const EMPTY_CODEGEN_ID = 'EMPTY_CURRENT_CODE_GENERATION_ID'
42+
const EmptyCodeGenID = 'EMPTY_CURRENT_CODE_GENERATION_ID'
4343

4444
export class ConversationNotStartedState implements Omit<SessionState, 'uploadId'> {
4545
public tokenSource: vscode.CancellationTokenSource
@@ -130,7 +130,7 @@ abstract class CodeGenBase {
130130
this.isCancellationRequested = false
131131
this.conversationId = config.conversationId
132132
this.uploadId = config.uploadId
133-
this.currentCodeGenerationId = config.currentCodeGenerationId || EMPTY_CODEGEN_ID
133+
this.currentCodeGenerationId = config.currentCodeGenerationId || EmptyCodeGenID
134134
}
135135

136136
async generateCode({
@@ -267,7 +267,9 @@ export class CodeGenState extends CodeGenBase implements SessionState {
267267

268268
action.tokenSource?.token.onCancellationRequested(() => {
269269
this.isCancellationRequested = true
270-
if (action.tokenSource) this.tokenSource = action.tokenSource
270+
if (action.tokenSource) {
271+
this.tokenSource = action.tokenSource
272+
}
271273
})
272274

273275
action.telemetry.setGenerateCodeIteration(this.currentIteration)

0 commit comments

Comments
 (0)