diff --git a/package.json b/package.json index 806f2721..e8ddeae0 100644 --- a/package.json +++ b/package.json @@ -366,6 +366,11 @@ "type": "boolean", "description": "%node.enableSourceMapCaching.description%", "default": true + }, + "_disableOptimisticBPs": { + "type": "boolean", + "description": "Don't set breakpoints in any file until a sourcemap has been loaded for that file.", + "default": true } } }, @@ -481,6 +486,11 @@ "type": "boolean", "description": "%node.enableSourceMapCaching.description%", "default": true + }, + "_disableOptimisticBPs": { + "type": "boolean", + "description": "Don't set breakpoints in any file until a sourcemap has been loaded for that file.", + "default": true } } } diff --git a/src/nodeDebugAdapter.ts b/src/nodeDebugAdapter.ts index c742797c..354e6b13 100644 --- a/src/nodeDebugAdapter.ts +++ b/src/nodeDebugAdapter.ts @@ -705,7 +705,7 @@ export class NodeDebugAdapter extends ChromeDebugAdapter { protected validateBreakpointsPath(args: ISetBreakpointsArgs): Promise { return super.validateBreakpointsPath(args).catch(e => { - if (args.source.path && utils.isJavaScript(args.source.path)) { + if (!this._launchAttachArgs._disableOptimisticBPs && args.source.path && utils.isJavaScript(args.source.path)) { return undefined; } else { return Promise.reject(e); diff --git a/src/nodeDebugInterfaces.d.ts b/src/nodeDebugInterfaces.d.ts index 9562fcee..98b4272d 100644 --- a/src/nodeDebugInterfaces.d.ts +++ b/src/nodeDebugInterfaces.d.ts @@ -17,6 +17,9 @@ export interface ICommonRequestArgs extends Core.ICommonRequestArgs { cwd?: string; /** Request frontend to restart session on termination. */ restart?: boolean; + + /** Don't set breakpoints in JS files that don't have sourcemaps */ + _disableOptimisticBPs?: boolean; } /**