Add default sourceMapPathOverrides

This commit is contained in:
roblou 2016-09-29 19:10:46 -07:00
Родитель ce8756b1a7
Коммит 7ae476ffb8
2 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -2,16 +2,22 @@
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
import {ChromeDebugAdapter as CoreDebugAdapter, logger, utils as coreUtils} from 'vscode-chrome-debug-core';
import {ChromeDebugAdapter as CoreDebugAdapter, logger, utils as coreUtils, ISourceMapPathOverrides} from 'vscode-chrome-debug-core';
import {spawn, ChildProcess} from 'child_process';
import {ILaunchRequestArgs} from './chromeDebugInterfaces';
import {ILaunchRequestArgs, IAttachRequestArgs} from './chromeDebugInterfaces';
import * as utils from './utils';
const DefaultWebsourceMapPathOverrides: ISourceMapPathOverrides = {
'webpack:///*': '${webRoot}/*',
'meteor://💻app/*': '${webRoot}/*'
};
export class ChromeDebugAdapter extends CoreDebugAdapter {
private _chromeProc: ChildProcess;
public launch(args: ILaunchRequestArgs): Promise<void> {
args.sourceMapPathOverrides = args.sourceMapPathOverrides || DefaultWebsourceMapPathOverrides;
return super.launch(args).then(() => {
// Check exists?
const chromePath = args.runtimeExecutable || utils.getBrowserPath();
@ -60,6 +66,11 @@ export class ChromeDebugAdapter extends CoreDebugAdapter {
});
}
public attach(args: IAttachRequestArgs): Promise<void> {
args.sourceMapPathOverrides = args.sourceMapPathOverrides || DefaultWebsourceMapPathOverrides;
return super.attach(args);
}
public disconnect(): void {
if (this._chromeProc) {
this._chromeProc.kill('SIGINT');

3
src/chromeDebugInterfaces.d.ts поставляемый
Просмотреть файл

@ -13,3 +13,6 @@ export interface ILaunchRequestArgs extends Core.ILaunchRequestArgs {
address?: string;
port?: number;
}
export interface IAttachRequestArgs extends Core.IAttachRequestArgs {
}