Skip to content

Commit d63ceb5

Browse files
committed
fix(dev): apply fixes based on new eslint rules
1 parent 532e4e4 commit d63ceb5

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
@@ -138,7 +138,7 @@ abstract class CodeGenBase {
138138
this.isCancellationRequested = false
139139
this.conversationId = config.conversationId
140140
this.uploadId = config.uploadId
141-
this.currentCodeGenerationId = config.currentCodeGenerationId || EMPTY_CODEGEN_ID
141+
this.currentCodeGenerationId = config.currentCodeGenerationId || EmptyCodeGenID
142142
}
143143

144144
async generateCode({
@@ -275,7 +275,9 @@ export class CodeGenState extends CodeGenBase implements SessionState {
275275

276276
action.tokenSource?.token.onCancellationRequested(() => {
277277
this.isCancellationRequested = true
278-
if (action.tokenSource) this.tokenSource = action.tokenSource
278+
if (action.tokenSource) {
279+
this.tokenSource = action.tokenSource
280+
}
279281
})
280282

281283
action.telemetry.setGenerateCodeIteration(this.currentIteration)

0 commit comments

Comments
 (0)