Add breakOnLoadStrategy launch config prop

This commit is contained in:
Rob Lourens 2017-12-11 21:48:44 -08:00
Родитель 76996b468b
Коммит 94b52b93b8
4 изменённых файлов: 22 добавлений и 3 удалений

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

@ -266,6 +266,21 @@
"type": "boolean",
"description": "%chrome.breakOnLoad.description",
"default": true
},
"breakOnLoadStrategy": {
"type": "enum",
"enum": [
"off",
"instrument",
"regex"
],
"enumDescriptions": [
"%chrome.breakOnLoadStrategy.off.description%",
"%chrome.breakOnLoadStrategy.instrument.description%",
"%chrome.breakOnLoadStrategy.regex.description%"
],
"description": "%chrome.breakOnLoadStrategy.description",
"default": "instrument"
}
}
},

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

@ -25,5 +25,9 @@
"chrome.disableNetworkCache.description": "Controls whether to skip the network cache for each request",
"chrome.urlFilter.description": "Will search for a page with this url and attach to it, if found. Can have * wildcards.",
"chrome.showAsyncStacks.description": "Show the async calls that led to the current call stack",
"chrome.breakOnLoad.description": "If true, the debug adapter will pause briefly as each script is loaded, giving it a chance to hit breakpoints at the beginnings of those scripts. Has a perf impact."
"chrome.breakOnLoad.description": "If true, the debug adapter will pause briefly as each script is loaded, giving it a chance to hit breakpoints at the beginnings of those scripts. Has a perf impact.",
"chrome.breakOnLoadStrategy.description": "The strategy to use for breakOnLoad.",
"chrome.breakOnLoadStrategy.off.description": "Disable breakOnLoad",
"chrome.breakOnLoadStrategy.instrument.description": "Tell Chrome to pause as each script is loaded, resolving sourcemaps and setting breakpoints",
"chrome.breakOnLoadStrategy.regex.description": "Sets breakpoints optimistically in files with the same name as the file in which the breakpoint is set."
}

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

@ -43,7 +43,7 @@ export class ChromeDebugAdapter extends CoreDebugAdapter {
}
public launch(args: ILaunchRequestArgs): Promise<void> {
if (args.breakOnLoad) {
if (args.breakOnLoad && !args.breakOnLoadStrategy) {
args.breakOnLoadStrategy = 'instrument';
}

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

@ -89,7 +89,7 @@ export function getMockChromeConnectionApi(): IMockChromeConnectionAPI {
mockDebugger.callBase = true;
mockDebugger
.setup(x => x.enable())
.returns(() => Promise.resolve());
.returns(() => Promise.resolve(null));
const mockNetwork = Mock.ofInstance<Crdp.NetworkClient>(<any>getNetworkStubs());
mockNetwork.callBase = true;