Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e.debug/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: Debug Adapter client for Eclipse IDE (Incubation)
Bundle-SymbolicName: org.eclipse.lsp4e.debug;singleton:=true
Bundle-Vendor: Eclipse LSP4E
Bundle-Version: 0.15.15.qualifier
Bundle-Version: 0.15.16.qualifier
Bundle-Activator: org.eclipse.lsp4e.debug.DSPPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamsProxy;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.lsp4e.debug.DSPPlugin;
import org.eclipse.lsp4e.debug.debugmodel.DSPDebugTarget;
Expand Down Expand Up @@ -193,8 +194,8 @@ public Map<String, Object> getDspParameters() {
public String toString() {
return "DSPLaunchDelegateLaunchBuilder [configuration=" + configuration + ", mode=" + mode + ", launch="
+ launch + ", monitor=" + monitor + ", launchNotConnect=" + launchNotConnect + ", debugCmd="
+ debugCmd + ", debugCmdArgs=" + debugCmdArgs //
+ ", debugCmdEnvVars=" + (debugCmdEnvVars == null ? null : List.of(debugCmdEnvVars))
+ debugCmd + ", debugCmdArgs=" + debugCmdArgs //
+ ", debugCmdEnvVars=" + (debugCmdEnvVars == null ? null : List.of(debugCmdEnvVars))
+ ", monitorDebugAdapter=" + monitorDebugAdapter + ", server=" + server + ", port=" + port
+ ", dspParameters=" + dspParameters + "]";
}
Expand Down Expand Up @@ -303,6 +304,7 @@ public void launch(DSPLaunchDelegateLaunchBuilder builderSrc) throws CoreExcepti
builder.launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, Boolean.toString(true));
IProcess debugAdapterIProcess = DebugPlugin.newProcess(builder.launch, debugAdapterProcess,
"Debug Adapter");
final IStreamsProxy debugAdapterStreamsProxy = castNonNull(debugAdapterIProcess.getStreamsProxy());
builder.launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, initialCaptureOutput);

final var bytes = new ConcurrentLinkedQueue<Byte>();
Expand All @@ -329,17 +331,20 @@ public int read() throws IOException {
final var consoleCharset = consoleEncoding == null //
? Charset.defaultCharset()
: Charset.forName(consoleEncoding);
castNonNull(castNonNull(debugAdapterIProcess.getStreamsProxy()).getOutputStreamMonitor())
.addListener((text, monitor) -> {
for (byte b : text.getBytes(consoleCharset)) {
bytes.add(b);
}
});
castNonNull(debugAdapterStreamsProxy.getOutputStreamMonitor()).addListener((text, monitor) -> {
for (byte b : text.getBytes(consoleCharset)) {
bytes.add(b);
}
});
outputStream = new OutputStream() {
@Override
public void write(int b) throws IOException {
castNonNull(debugAdapterIProcess.getStreamsProxy())
.write(new String(new byte[] { (byte) b }));
debugAdapterStreamsProxy.write(new String(new byte[] { (byte) b }));
}

@Override
public void write(byte[] b, int off, int len) throws IOException {
debugAdapterStreamsProxy.write(new String(b, off, len));
}
};
cleanup = () -> {
Expand Down