Skip to content

Commit

Permalink
Remove redundant range variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Keegan Irby committed Nov 8, 2024
1 parent 4a7a75f commit 1f8d9dd
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ export class LiveTailCodeLensProvider implements vscode.CodeLensProvider {
}

private buildClearDocumentCodeLens(document: vscode.TextDocument): vscode.CodeLens {
const range = new vscode.Range(
new vscode.Position(document.lineCount - 1, 0),
new vscode.Position(document.lineCount - 1, 0)
)
const range = this.getBottomOfDocumentRange(document)
const command: vscode.Command = {
title: 'Clear document',
command: 'aws.cwl.clearDocument',
Expand All @@ -37,15 +34,19 @@ export class LiveTailCodeLensProvider implements vscode.CodeLensProvider {
}

private buildStopTailingCodeLens(document: vscode.TextDocument): vscode.CodeLens {
const range = new vscode.Range(
new vscode.Position(document.lineCount - 1, 0),
new vscode.Position(document.lineCount - 1, 0)
)
const range = this.getBottomOfDocumentRange(document)
const command: vscode.Command = {
title: 'Stop tailing',
command: 'aws.cwl.stopTailingLogGroup',
arguments: [document],
}
return new vscode.CodeLens(range, command)
}

private getBottomOfDocumentRange(document: vscode.TextDocument): vscode.Range {
return new vscode.Range(
new vscode.Position(document.lineCount - 1, 0),
new vscode.Position(document.lineCount - 1, 0)
)
}
}

0 comments on commit 1f8d9dd

Please sign in to comment.