@@ -110,18 +110,12 @@ async function runPerf(options: CLIOpts) {
110110 const config : TSServerConfig =
111111 JSON . parse ( await fs . promises . readFile ( options . commands , { encoding : "utf-8" } ) ) . tsserverConfig ;
112112 const solution = path . resolve ( path . join ( options . suite , config . solution ) ) ;
113- let lspServerPath = path . resolve ( options . lsp ) ;
113+ const lspServerPath = path . resolve ( options . lsp ) ;
114114 // Needed for excludedDirectories
115115 process . chdir ( solution ) ;
116116
117117 const serverArgs : string [ ] = [ "--lsp" , "--stdio" ] ;
118118
119- // If the server is a JS file, run it under Node.js
120- if ( path . extname ( lspServerPath ) . toLowerCase ( ) === ".js" ) {
121- serverArgs . unshift ( lspServerPath ) ;
122- lspServerPath = process . execPath ;
123- }
124-
125119 const serverProc = cp . spawn ( lspServerPath , serverArgs , {
126120 stdio : [ "pipe" , "pipe" , "ignore" ] ,
127121 } ) ;
@@ -152,7 +146,7 @@ async function runPerf(options: CLIOpts) {
152146 throw new Error ( "--cpus only works on Linux" ) ;
153147 }
154148
155- // Set CPU affinity after the server starts (same approach as measuretsserver.ts)
149+ // Set CPU affinity after the server starts (same as measuretsserver.ts)
156150 execFileSync ( "taskset" , [ "--all-tasks" , "--cpu-list" , "--pid" , options . cpus , `${ serverProc . pid } ` ] ) ;
157151 }
158152
@@ -219,7 +213,7 @@ async function runPerf(options: CLIOpts) {
219213 const command = config . commands [ i ] ;
220214 if ( command ) {
221215 if ( options . cpus ) {
222- // Sleeping between commands prevents high variance when constraining to a single core
216+ // Sleeping between commands prevents high variance when constrained to a single core
223217 await sleep ( 1000 ) ;
224218 }
225219 await runCommand ( command , seq ++ ) ;
@@ -308,13 +302,12 @@ async function runPerf(options: CLIOpts) {
308302 async function references ( command : TSServerReferencesCommand , _seq : number ) : Promise < number > {
309303 const file = path . join ( solution , command . args . file ) ;
310304 const fileUri = filePathToUri ( file ) ;
311- // tsserver uses 1-based line/offset; LSP uses 0-based line/character
312305 const start = performance . now ( ) ;
313306 await connection . sendRequest ( protocol . ReferencesRequest . method , {
314307 textDocument : { uri : fileUri } ,
315308 position : {
316- line : command . args . line - 1 ,
317- character : command . args . offset - 1 ,
309+ line : command . args . line ,
310+ character : command . args . offset ,
318311 } ,
319312 context : { includeDeclaration : true } ,
320313 } as protocol . ReferenceParams ) ;
@@ -340,8 +333,8 @@ async function runPerf(options: CLIOpts) {
340333 {
341334 textDocument : { uri : fileUri } ,
342335 position : {
343- line : command . args . line - 1 ,
344- character : command . args . offset - 1 ,
336+ line : command . args . line ,
337+ character : command . args . offset ,
345338 } ,
346339 } as protocol . CompletionParams ,
347340 ) ;
0 commit comments