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