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' ;
33import * as fs from 'fs' ;
44import * 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
811export 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
223226export 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+ } ;
0 commit comments