@@ -24,10 +24,7 @@ export class LiveTailCodeLensProvider implements vscode.CodeLensProvider {
2424 }
2525
2626 private buildClearDocumentCodeLens ( document : vscode . TextDocument ) : vscode . CodeLens {
27- const range = new vscode . Range (
28- new vscode . Position ( document . lineCount - 1 , 0 ) ,
29- new vscode . Position ( document . lineCount - 1 , 0 )
30- )
27+ const range = this . getBottomOfDocumentRange ( document )
3128 const command : vscode . Command = {
3229 title : 'Clear document' ,
3330 command : 'aws.cwl.clearDocument' ,
@@ -37,15 +34,19 @@ export class LiveTailCodeLensProvider implements vscode.CodeLensProvider {
3734 }
3835
3936 private buildStopTailingCodeLens ( document : vscode . TextDocument ) : vscode . CodeLens {
40- const range = new vscode . Range (
41- new vscode . Position ( document . lineCount - 1 , 0 ) ,
42- new vscode . Position ( document . lineCount - 1 , 0 )
43- )
37+ const range = this . getBottomOfDocumentRange ( document )
4438 const command : vscode . Command = {
4539 title : 'Stop tailing' ,
4640 command : 'aws.cwl.stopTailingLogGroup' ,
4741 arguments : [ document ] ,
4842 }
4943 return new vscode . CodeLens ( range , command )
5044 }
45+
46+ private getBottomOfDocumentRange ( document : vscode . TextDocument ) : vscode . Range {
47+ return new vscode . Range (
48+ new vscode . Position ( document . lineCount - 1 , 0 ) ,
49+ new vscode . Position ( document . lineCount - 1 , 0 )
50+ )
51+ }
5152}
0 commit comments