@@ -60,7 +60,7 @@ export function activate(context: ExtensionContext) {
60
60
const portFile = path . join ( workspaceRoot , ".dotty-ide-dev-port" )
61
61
fs . readFile ( portFile , ( err , port ) => {
62
62
if ( err ) {
63
- outputChannel . append ( `Unable to parse ${ portFile } ` )
63
+ outputChannel . appendLine ( `Unable to parse ${ portFile } ` )
64
64
throw err
65
65
}
66
66
@@ -219,9 +219,15 @@ function runLanguageServer(coursierPath: string, languageServerArtifactFile: str
219
219
function startNewSbtInstance ( log : vscode . OutputChannel , coursierPath : string ) {
220
220
fetchWithCoursier ( coursierPath , sbtArtifact ) . then ( ( sbtClasspath ) => {
221
221
sbtProcess = cpp . spawn ( "java" , [
222
+ "-Dsbt.log.noformat=true" ,
222
223
"-classpath" , sbtClasspath ,
223
224
"xsbt.boot.Boot"
224
225
] ) . childProcess
226
+
227
+ // Close stdin, otherwise in case of error sbt will block waiting for the
228
+ // user input to reload or exit the build.
229
+ sbtProcess . stdin . end ( )
230
+
225
231
sbtProcess . stdout . on ( 'data' , data => {
226
232
log . append ( data . toString ( ) )
227
233
} )
@@ -263,11 +269,15 @@ function fetchWithCoursier(coursierPath: string, artifact: string, extra: string
263
269
coursierProc . stdout . on ( 'data' , ( data : Buffer ) => {
264
270
classPath += data . toString ( ) . trim ( )
265
271
} )
272
+ coursierProc . stderr . on ( 'data' , ( data : Buffer ) => {
273
+ let msg = data . toString ( ) . trim ( )
274
+ outputChannel . appendLine ( msg )
275
+ } )
266
276
267
277
coursierProc . on ( 'close' , ( code : number ) => {
268
278
if ( code != 0 ) {
269
279
let msg = `Couldn't fetch '${ artifact } ' (exit code ${ code } ).`
270
- outputChannel . append ( msg )
280
+ outputChannel . appendLine ( msg )
271
281
throw new Error ( msg )
272
282
}
273
283
} )
0 commit comments