Skip to content

Commit 9ab2df0

Browse files
committed
lint
1 parent 0ba37d8 commit 9ab2df0

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

packages/core/src/awsService/cloudWatchLogs/commands/tailLogGroup.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export async function tailLogGroup(
3131
throw new CancellationError('user')
3232
}
3333
if (wizardResponse.logStreamFilter.type === 'menu' || wizardResponse.logStreamFilter.type === undefined) {
34-
//logstream filter wizard uses type to determine which submenu to show. 'menu' is set when no type is selected
35-
//and to show the 'menu' of selecting a type. This should not be reachable due to the picker logic, but validating in case.
34+
// logstream filter wizard uses type to determine which submenu to show. 'menu' is set when no type is selected
35+
// and to show the 'menu' of selecting a type. This should not be reachable due to the picker logic, but validating in case.
3636
throw new ToolkitError(`Invalid Log Stream filter type: ${wizardResponse.logStreamFilter.type}`)
3737
}
3838
const awsCredentials = await globals.awsContext.getCredentials()
@@ -134,8 +134,8 @@ async function handleSessionStream(
134134
formatLogEvent(logEvent)
135135
)
136136
if (formattedLogEvents.length !== 0) {
137-
//Determine should scroll before adding new lines to doc because adding large
138-
//amount of new lines can push bottom of file out of view before scrolling.
137+
// Determine should scroll before adding new lines to doc because adding large
138+
// amount of new lines can push bottom of file out of view before scrolling.
139139
const editorsToScroll = getTextEditorsToScroll(document)
140140
await updateTextDocumentWithNewLogEvents(formattedLogEvents, document, session.maxLines)
141141
editorsToScroll.forEach(scrollTextEditorToBottom)
@@ -146,13 +146,13 @@ async function handleSessionStream(
146146
}
147147
} catch (e) {
148148
if (session.isAborted) {
149-
//Expected case. User action cancelled stream (CodeLens, Close Editor, etc.).
150-
//AbortSignal interrupts the LiveTail stream, causing error to be thrown here.
151-
//Can assume that stopLiveTailSession() has already been called - AbortSignal is only
152-
//exposed through that method.
149+
// Expected case. User action cancelled stream (CodeLens, Close Editor, etc.).
150+
// AbortSignal interrupts the LiveTail stream, causing error to be thrown here.
151+
// Can assume that stopLiveTailSession() has already been called - AbortSignal is only
152+
// exposed through that method.
153153
getLogger().info(`LiveTail session stopped: ${uriToKey(session.uri)}`)
154154
} else {
155-
//Unexpected exception.
155+
// Unexpected exception.
156156
session.stopLiveTailSession()
157157
throw ToolkitError.chain(
158158
e,
@@ -178,8 +178,8 @@ function formatLogEvent(logEvent: LiveTailSessionLogEvent): string {
178178
return line
179179
}
180180

181-
//Auto scroll visible LiveTail session editors if the end-of-file is in view.
182-
//This allows for newly added log events to stay in view.
181+
// Auto scroll visible LiveTail session editors if the end-of-file is in view.
182+
// This allows for newly added log events to stay in view.
183183
function getTextEditorsToScroll(document: vscode.TextDocument): vscode.TextEditor[] {
184184
return vscode.window.visibleTextEditors.filter((editor) => {
185185
if (editor.document !== document) {

packages/core/src/awsService/cloudWatchLogs/document/liveTailCodeLensProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class LiveTailCodeLensProvider implements vscode.CodeLensProvider {
1919
token: vscode.CancellationToken
2020
): vscode.ProviderResult<vscode.CodeLens[]> {
2121
const uri = document.uri
22-
//if registry does not contain session, it is assumed to have been stopped, thus, hide lenses.
22+
// if registry does not contain session, it is assumed to have been stopped, thus, hide lenses.
2323
if (uri.scheme !== cloudwatchLogsLiveTailScheme || !this.registry.has(uriToKey(uri))) {
2424
return []
2525
}

packages/core/src/awsService/cloudWatchLogs/document/liveTailDocumentProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as vscode from 'vscode'
77

88
export class LiveTailDocumentProvider implements vscode.TextDocumentContentProvider {
99
provideTextDocumentContent(uri: vscode.Uri, token: vscode.CancellationToken): vscode.ProviderResult<string> {
10-
//Content will be written to the document via handling a LiveTail response stream in the TailLogGroup command.
10+
// Content will be written to the document via handling a LiveTail response stream in the TailLogGroup command.
1111
return ''
1212
}
1313
}

packages/core/src/awsService/cloudWatchLogs/registry/liveTailSession.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class LiveTailSession {
4242
private _eventRate: number
4343
private _isSampled: boolean
4444

45-
//While session is running, used to update the StatusBar each half second.
45+
// While session is running, used to update the StatusBar each half second.
4646
private statusBarUpdateTimer: NodeJS.Timer | undefined
4747

4848
static settings = new CloudWatchLogsSettings(Settings.instance)
@@ -110,11 +110,11 @@ export class LiveTailSession {
110110
}
111111

112112
public getLiveTailSessionDuration(): number {
113-
//Never started
113+
// Never started
114114
if (this.startTime === undefined) {
115115
return 0
116116
}
117-
//Currently running
117+
// Currently running
118118
if (this.endTime === undefined) {
119119
return globals.clock.Date.now() - this.startTime
120120
}

packages/core/src/test/awsService/cloudWatchLogs/commands/tailLogGroup.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ describe('TailLogGroup', function () {
5656
getSessionUpdateFrame(false, `${testMessage}-2`, startTimestamp + 2000),
5757
getSessionUpdateFrame(false, `${testMessage}-3`, startTimestamp + 3000),
5858
]
59-
//Returns the configured update frames and then indefinitely blocks.
60-
//This keeps the stream 'open', simulating an open network stream waiting for new events.
61-
//If the stream were to close, the event listeners in the TailLogGroup command would dispose,
62-
//breaking the 'closes tab closes session' assertions this test makes.
59+
// Returns the configured update frames and then indefinitely blocks.
60+
// This keeps the stream 'open', simulating an open network stream waiting for new events.
61+
// If the stream were to close, the event listeners in the TailLogGroup command would dispose,
62+
// breaking the 'closes tab closes session' assertions this test makes.
6363
async function* generator(): AsyncIterable<StartLiveTailResponseStream> {
6464
for (const frame of updateFrames) {
6565
yield frame
@@ -78,21 +78,21 @@ describe('TailLogGroup', function () {
7878
wizardSpy = sandbox.stub(TailLogGroupWizard.prototype, 'run').callsFake(async function () {
7979
return getTestWizardResponse()
8080
})
81-
//Set maxLines to 1.
81+
// Set maxLines to 1.
8282
cloudwatchSettingsSpy = sandbox.stub(CloudWatchLogsSettings.prototype, 'get').callsFake(() => {
8383
return 1
8484
})
8585

86-
//The mock stream doesn't 'close', causing tailLogGroup to not return. If we `await`, it will never resolve.
87-
//Run it in the background and use waitUntil to poll its state.
86+
// The mock stream doesn't 'close', causing tailLogGroup to not return. If we `await`, it will never resolve.
87+
// Run it in the background and use waitUntil to poll its state.
8888
void tailLogGroup(registry, testSource, codeLensProvider, {
8989
groupName: testLogGroup,
9090
regionName: testRegion,
9191
})
9292
await waitUntil(async () => registry.size !== 0, { interval: 100, timeout: 1000 })
9393

94-
//registry is asserted to have only one entry, so this is assumed to be the session that was
95-
//started in this test.
94+
// registry is asserted to have only one entry, so this is assumed to be the session that was
95+
// started in this test.
9696
let sessionUri: vscode.Uri | undefined
9797
registry.forEach((session) => (sessionUri = session.uri))
9898
if (sessionUri === undefined) {
@@ -104,8 +104,8 @@ describe('TailLogGroup', function () {
104104
assert.strictEqual(startLiveTailSessionSpy.calledOnce, true)
105105
assert.strictEqual(registry.size, 1)
106106

107-
//Validate writing to the document.
108-
//MaxLines is set to 1, and "testMessage3" is the last event in the stream, its contents should be the only thing in the doc.
107+
// Validate writing to the document.
108+
// MaxLines is set to 1, and "testMessage3" is the last event in the stream, its contents should be the only thing in the doc.
109109
const window = getTestWindow()
110110
const document = window.activeTextEditor?.document
111111
assert.strictEqual(sessionUri.toString(), document?.uri.toString())
@@ -115,7 +115,7 @@ describe('TailLogGroup', function () {
115115
)
116116
assert.strictEqual(doesDocumentContainExpectedContent, true)
117117

118-
//Test that closing all tabs the session's document is open in will cause the session to close
118+
// Test that closing all tabs the session's document is open in will cause the session to close
119119
let tabs: vscode.Tab[] = []
120120
window.tabGroups.all.forEach((tabGroup) => {
121121
tabs = tabs.concat(getLiveTailSessionTabsFromTabGroup(tabGroup, sessionUri!))

packages/core/src/test/awsService/cloudWatchLogs/registry/liveTailSession.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('LiveTailSession', async function () {
117117
assert.strictEqual(session.isAborted, true)
118118
assert.strictEqual(clock.countTimers(), 0)
119119

120-
//Session is stopped; ticking the clock forward should not change the session duration
120+
// Session is stopped; ticking the clock forward should not change the session duration
121121
clock.tick(1000)
122122
assert.strictEqual(session.getLiveTailSessionDuration(), 1000)
123123
})

0 commit comments

Comments
 (0)