mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
clone DAP messages properly
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user