3636import org .eclipse .debug .core .model .IDebugTarget ;
3737import org .eclipse .debug .core .model .ILaunchConfigurationDelegate ;
3838import org .eclipse .debug .core .model .IProcess ;
39+ import org .eclipse .debug .core .model .IStreamsProxy ;
3940import org .eclipse .jdt .annotation .Nullable ;
4041import org .eclipse .lsp4e .debug .DSPPlugin ;
4142import org .eclipse .lsp4e .debug .debugmodel .DSPDebugTarget ;
@@ -193,8 +194,8 @@ public Map<String, Object> getDspParameters() {
193194 public String toString () {
194195 return "DSPLaunchDelegateLaunchBuilder [configuration=" + configuration + ", mode=" + mode + ", launch="
195196 + launch + ", monitor=" + monitor + ", launchNotConnect=" + launchNotConnect + ", debugCmd="
196- + debugCmd + ", debugCmdArgs=" + debugCmdArgs //
197- + ", debugCmdEnvVars=" + (debugCmdEnvVars == null ? null : List .of (debugCmdEnvVars ))
197+ + debugCmd + ", debugCmdArgs=" + debugCmdArgs //
198+ + ", debugCmdEnvVars=" + (debugCmdEnvVars == null ? null : List .of (debugCmdEnvVars ))
198199 + ", monitorDebugAdapter=" + monitorDebugAdapter + ", server=" + server + ", port=" + port
199200 + ", dspParameters=" + dspParameters + "]" ;
200201 }
@@ -303,6 +304,7 @@ public void launch(DSPLaunchDelegateLaunchBuilder builderSrc) throws CoreExcepti
303304 builder .launch .setAttribute (DebugPlugin .ATTR_CAPTURE_OUTPUT , Boolean .toString (true ));
304305 IProcess debugAdapterIProcess = DebugPlugin .newProcess (builder .launch , debugAdapterProcess ,
305306 "Debug Adapter" );
307+ final IStreamsProxy debugAdapterStreamsProxy = castNonNull (debugAdapterIProcess .getStreamsProxy ());
306308 builder .launch .setAttribute (DebugPlugin .ATTR_CAPTURE_OUTPUT , initialCaptureOutput );
307309
308310 final var bytes = new ConcurrentLinkedQueue <Byte >();
@@ -329,17 +331,20 @@ public int read() throws IOException {
329331 final var consoleCharset = consoleEncoding == null //
330332 ? Charset .defaultCharset ()
331333 : Charset .forName (consoleEncoding );
332- castNonNull (castNonNull (debugAdapterIProcess .getStreamsProxy ()).getOutputStreamMonitor ())
333- .addListener ((text , monitor ) -> {
334- for (byte b : text .getBytes (consoleCharset )) {
335- bytes .add (b );
336- }
337- });
334+ castNonNull (debugAdapterStreamsProxy .getOutputStreamMonitor ()).addListener ((text , monitor ) -> {
335+ for (byte b : text .getBytes (consoleCharset )) {
336+ bytes .add (b );
337+ }
338+ });
338339 outputStream = new OutputStream () {
339340 @ Override
340341 public void write (int b ) throws IOException {
341- castNonNull (debugAdapterIProcess .getStreamsProxy ())
342- .write (new String (new byte [] { (byte ) b }));
342+ debugAdapterStreamsProxy .write (new String (new byte [] { (byte ) b }));
343+ }
344+
345+ @ Override
346+ public void write (byte [] b , int off , int len ) throws IOException {
347+ debugAdapterStreamsProxy .write (new String (b , off , len ));
343348 }
344349 };
345350 cleanup = () -> {
0 commit comments