Skip to content

Commit d2c49a1

Browse files
lint
1 parent 783335d commit d2c49a1

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

local-libs/traceviewer-libs/react-components/src/components/utils/time-range-data-map.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { ExperimentTimeRangeData } from '../../trace-explorer/trace-explorer-tim
33
import { Experiment } from 'tsp-typescript-client/lib/models/experiment';
44

55
export class TimeRangeDataMap {
6-
private static _experimentDataMap: Map<string, ExperimentTimeRangeData> = new Map<string, ExperimentTimeRangeData>();
6+
private static _experimentDataMap: Map<string, ExperimentTimeRangeData> = new Map<
7+
string,
8+
ExperimentTimeRangeData
9+
>();
710
private static _activeData?: ExperimentTimeRangeData;
811
constructor() {
912
// Static class pattern: no instance initialization required

vscode-trace-extension/src/csv-download/csv-download.ts

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { TimeRangeDataMap } from "traceviewer-react-components/lib/components/utils/time-range-data-map";
2-
import * as vscode from 'vscode'
1+
import { TimeRangeDataMap } from 'traceviewer-react-components/lib/components/utils/time-range-data-map';
2+
import * as vscode from 'vscode';
33
import * as fs from 'fs';
44
import * as path from 'path';
5-
import { getTspClient } from "../utils/backend-tsp-client-provider";
6-
import { QueryHelper } from "tsp-typescript-client";
5+
import { getTspClient } from '../utils/backend-tsp-client-provider';
6+
import { QueryHelper } from 'tsp-typescript-client';
7+
8+
/* eslint-disable @typescript-eslint/no-explicit-any */
9+
710

811
export const exportCSV = async (outputID: string) => {
9-
1012
// Helper FUnctions
1113
const REQUEST_SIZE = 1000;
1214
const WRITE_HIGH_WATERMARK = 1 << 20; // 1 MiB
@@ -51,11 +53,9 @@ export const exportCSV = async (outputID: string) => {
5153

5254
const uri = await vscode.window.showSaveDialog({
5355
title: 'Save CSV File',
54-
defaultUri: vscode.Uri.file(
55-
path.join(vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '', 'data.csv')
56-
),
56+
defaultUri: vscode.Uri.file(path.join(vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '', 'data.csv')),
5757
filters: { 'CSV Files': ['csv'] },
58-
saveLabel: 'Save CSV',
58+
saveLabel: 'Save CSV'
5959
});
6060
if (!uri) {
6161
vscode.window.showInformationMessage('Save cancelled.');
@@ -94,7 +94,7 @@ export const exportCSV = async (outputID: string) => {
9494

9595
const indexBody = (requestedTime: bigint) => ({
9696
requested_times: [requestedTime],
97-
requested_table_count: 1,
97+
requested_table_count: 1
9898
});
9999

100100
const t1Req = await tsp.fetchTableLines(
@@ -139,11 +139,15 @@ export const exportCSV = async (outputID: string) => {
139139
requested_table_column_ids: headerNames.map((_, i) => i),
140140
requested_table_count: count,
141141
requested_table_index: index,
142-
table_search_expressions: {},
142+
table_search_expressions: {}
143143
});
144144

145145
// Prime first request
146-
let ongoing = tsp.fetchTableLines(activeData.UUID, outputID, QueryHelper.query(makeLinesBody(nextIndex, nextCount)));
146+
let ongoing = tsp.fetchTableLines(
147+
activeData.UUID,
148+
outputID,
149+
QueryHelper.query(makeLinesBody(nextIndex, nextCount))
150+
);
147151

148152
const writeLines = async (lines: any[]) => {
149153
const lineStrings: string[] = [];
@@ -173,10 +177,10 @@ export const exportCSV = async (outputID: string) => {
173177
ongoing =
174178
nextCount > 0
175179
? tsp.fetchTableLines(
176-
activeData.UUID,
177-
outputID,
178-
QueryHelper.query(makeLinesBody(nextIndex, nextCount))
179-
)
180+
activeData.UUID,
181+
outputID,
182+
QueryHelper.query(makeLinesBody(nextIndex, nextCount))
183+
)
180184
: Promise.resolve({ getModel: () => ({ model: { lines: [] } }) } as any);
181185

182186
await writeLines(currentLines);
@@ -189,7 +193,6 @@ export const exportCSV = async (outputID: string) => {
189193
increment: pct - (progress as any)._lastPct
190194
});
191195
(progress as any)._lastPct = pct;
192-
193196
}
194197

195198
if (token.isCancellationRequested) {
@@ -218,7 +221,7 @@ export const exportCSV = async (outputID: string) => {
218221
}
219222
}
220223
);
221-
}
224+
};
222225

223226
export const queryForOutputType = async () => {
224227
const tsp = getTspClient();
@@ -240,9 +243,8 @@ export const queryForOutputType = async () => {
240243
title: 'Select a table output',
241244
placeHolder: 'pick one',
242245
matchOnDescription: true,
243-
canPickMany: false,
244-
})
246+
canPickMany: false
247+
});
245248

246249
return selection?.id;
247-
248-
}
250+
};

vscode-trace-extension/src/extension.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { TraceServerManager } from './utils/trace-server-manager';
3333
import { ResourceType, TraceExplorerResourceTypeHandler } from './utils/trace-explorer-resource-type-handler';
3434
import { exportCSV, queryForOutputType } from './csv-download/csv-download';
3535

36-
3736
export let traceLogger: TraceExtensionLogger;
3837
export const traceExtensionWebviewManager: TraceExtensionWebviewManager = new TraceExtensionWebviewManager();
3938
export const traceServerManager: TraceServerManager = new TraceServerManager();

0 commit comments

Comments
 (0)