never convert relative paths to URIs; fixes #60667

This commit is contained in:
Andre Weinand
2018-10-17 16:47:22 +02:00
parent f0101b07d4
commit 48adb204e9
4 changed files with 58 additions and 33 deletions

View File

@@ -14,9 +14,8 @@ import {
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import severity from 'vs/base/common/severity';
import { AbstractDebugAdapter } from 'vs/workbench/parts/debug/node/debugAdapter';
import * as paths from 'vs/base/common/paths';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/parts/debug/common/debugUtils';
import { convertToVSCPaths, convertToDAPaths, stringToUri, uriToString } from 'vs/workbench/parts/debug/common/debugUtils';
import { deepClone } from 'vs/base/common/objects';
@@ -215,11 +214,7 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
public $acceptDAMessage(handle: number, message: DebugProtocol.ProtocolMessage) {
convertToVSCPaths(message, source => {
if (typeof source.path === 'object') {
source.path = uri.revive(source.path).toString();
}
});
convertToVSCPaths(message, source => uriToString(source));
this._debugAdapters.get(handle).acceptMessage(message);
}
@@ -302,13 +297,7 @@ class ExtensionHostDebugAdapter extends AbstractDebugAdapter {
// since we modify Source.paths in the message in place, we need to make a copy of it (see #61129)
const msg = deepClone(message);
convertToDAPaths(msg, source => {
if (paths.isAbsolute(source.path)) {
(<any>source).path = uri.file(source.path);
} else {
(<any>source).path = uri.parse(source.path);
}
});
convertToDAPaths(msg, source => stringToUri(source));
this._proxy.$sendDAMessage(this._handle, msg);
}

View File

@@ -27,7 +27,7 @@ import { getTerminalLauncher, hasChildprocesses, prepareCommand } from 'vs/workb
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { AbstractVariableResolverService } from 'vs/workbench/services/configurationResolver/node/variableResolver';
import { ExtHostConfiguration } from './extHostConfiguration';
import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/parts/debug/common/debugUtils';
import { convertToVSCPaths, convertToDAPaths, stringToUri, uriToString } from 'vs/workbench/parts/debug/common/debugUtils';
import { ExtHostTerminalService } from 'vs/workbench/api/node/extHostTerminalService';
import { IDisposable } from 'vs/base/common/lifecycle';
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
@@ -400,11 +400,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
}
// DA -> VS Code
convertToVSCPaths(msg, source => {
if (paths.isAbsolute(source.path)) {
(<any>source).path = URI.file(source.path);
}
});
convertToVSCPaths(msg, source => stringToUri(source));
mythis._debugServiceProxy.$acceptDAMessage(handle, msg);
});
@@ -435,11 +431,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
public $sendDAMessage(handle: number, message: DebugProtocol.ProtocolMessage): TPromise<void> {
// VS Code -> DA
convertToDAPaths(message, source => {
if (typeof source.path === 'object') {
source.path = URI.revive(source.path).fsPath;
}
});
convertToDAPaths(message, source => uriToString(source));
const tracker = this._debugAdaptersTrackers.get(handle);
if (tracker) {