clone DAP messages properly

This commit is contained in:
Andre Weinand
2018-11-06 12:07:45 +01:00
parent edf7e05230
commit c48845126e
3 changed files with 20 additions and 20 deletions

View File

@@ -9,7 +9,6 @@ import { URI, UriComponents } from 'vs/base/common/uri';
import { Event, Emitter } from 'vs/base/common/event';
import { asThenable } from 'vs/base/common/async';
import * as nls from 'vs/nls';
import { deepClone } from 'vs/base/common/objects';
import {
MainContext, MainThreadDebugServiceShape, ExtHostDebugServiceShape, DebugSessionUUID,
IMainContext, IBreakpointsDeltaDto, ISourceMultiBreakpointDto, IFunctionBreakpointDto, IDebugSessionDto
@@ -391,17 +390,14 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
da.onMessage(message => {
// since we modify Source.paths in the message in place, we need to make a copy of it (see #61129)
const msg = deepClone(message);
if (tracker) {
tracker.fromDebugAdapter(msg);
tracker.fromDebugAdapter(message);
}
// DA -> VS Code
convertToVSCPaths(msg, source => stringToUri(source));
message = convertToVSCPaths(message, source => stringToUri(source));
mythis._debugServiceProxy.$acceptDAMessage(handle, msg);
mythis._debugServiceProxy.$acceptDAMessage(handle, message);
});
da.onError(err => {
if (tracker) {
@@ -429,8 +425,9 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
}
public $sendDAMessage(handle: number, message: DebugProtocol.ProtocolMessage): Promise<void> {
// VS Code -> DA
convertToDAPaths(message, source => uriToString(source));
message = convertToDAPaths(message, source => uriToString(source));
const tracker = this._debugAdaptersTrackers.get(handle);
if (tracker) {