1 year ago
#346670
Efratror
vs code language server pipe output of childproces to client
I'm creating my own language-server extension. I've piped the output of a childprocess to the console and the extension outputChannel. The problem is that the console output updates while running the childprocess but the outputChannel updates only after de childprocess is closed. Do you have suggestions on how to fix this?
Here's part of my code:
let output = client.outputChannel
console.info("Start the sketch")
output.appendLine("Start the sketch")
let runProces = childProcess.spawn(command,
{cwd: workDir, shell: true, stdio: ['pipe', 'pipe', 'pipe']})
//Pipe childProcess output to extenstion output
runProces.stdout.on('data', data => {
console.log(`${data}`)
output.append(data.toString())
output.show();
})
runProces.stderr.on('data', (data) =>{
console.log(`${data}`)
})
runProces.on('close', (close) =>{
console.info(`Sketch ended`)
output.appendLine("Sketch ended")
})
typescript
pipe
vscode-extensions
language-server-protocol
0 Answers
Your Answer