@@ -32,7 +32,7 @@ import {
3232} from './types'
3333import { Writable } from 'stream'
3434import { CodeWhispererSettings } from '../../codewhisperer/util/codewhispererSettings'
35- import { fs , getLogger , globals } from '../../shared'
35+ import { ExecutablePaths , fs , getLogger , globals } from '../../shared'
3636
3737const localize = nls . loadMessageBundle ( )
3838
@@ -172,7 +172,7 @@ export class LspClient {
172172 * It will create a output channel named Amazon Q Language Server.
173173 * This function assumes the LSP server has already been downloaded.
174174 */
175- export async function activate ( extensionContext : ExtensionContext , serverModule : string ) {
175+ export async function activate ( extensionContext : ExtensionContext , executablePaths : ExecutablePaths ) {
176176 LspClient . instance
177177 const toDispose = extensionContext . subscriptions
178178
@@ -195,12 +195,9 @@ export async function activate(extensionContext: ExtensionContext, serverModule:
195195 delete process . env . Q_WORKER_THREADS
196196 }
197197
198- const nodename = process . platform === 'win32' ? 'node.exe' : 'node'
198+ const serverModule = executablePaths . lsp
199199
200- const child = spawn ( extensionContext . asAbsolutePath ( path . join ( 'resources' , nodename ) ) , [
201- serverModule ,
202- ...debugOptions . execArgv ,
203- ] )
200+ const child = spawn ( executablePaths . node , [ serverModule , ...debugOptions . execArgv ] )
204201 // share an encryption key using stdin
205202 // follow same practice of DEXP LSP server
206203 writeEncryptionInit ( child . stdin )
0 commit comments