diff --git a/CHANGELOG.md b/CHANGELOG.md index 2be715277..1bcd3ed9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This changelog records changes to stable releases since 1.50.2. "TBA" changes he - fix: don't show quick pick when there is only a single npm script ([#851](https://github.com/microsoft/vscode-js-debug/issues/851)) - fix: don't narrow outfiles on any remoteRoot ([#854](https://github.com/microsoft/vscode-js-debug/issues/854)) - fix: more thoroughly clean VS Code-specific environment variables from launch ([#64897](https://github.com/microsoft/vscode/issues/64897), [#38428](https://github.com/microsoft/vscode/issues/38428)) +- fix: node internals not skipping on Node 15 ([#862](https://github.com/microsoft/vscode-js-debug/issues/862)) ## v1.51.0 - 2020-10-26 diff --git a/src/adapter/scriptSkipper/implementation.ts b/src/adapter/scriptSkipper/implementation.ts index 6a33c1fd8..9e0c629a4 100644 --- a/src/adapter/scriptSkipper/implementation.ts +++ b/src/adapter/scriptSkipper/implementation.ts @@ -32,6 +32,8 @@ interface ISharedSkipToggleEvent { params: Dap.ToggleSkipFileStatusParams; } +const node15InternalsPrefix = 'node:'; + @injectable() export class ScriptSkipper { private static sharedSkipsEmitter = new EventEmitter(); @@ -117,11 +119,15 @@ export class ScriptSkipper { } private _testSkipNodeInternal(testString: string): boolean { - if (this._nodeInternalsGlobs) { - return micromatch([testString], this._nodeInternalsGlobs).length > 0; + if (!this._nodeInternalsGlobs) { + return false; } - return false; + if (testString.startsWith(node15InternalsPrefix)) { + testString = testString.slice(node15InternalsPrefix.length); + } + + return micromatch([testString], this._nodeInternalsGlobs).length > 0; } private _testSkipNonNodeInternal(testString: string): boolean { @@ -137,6 +143,10 @@ export class ScriptSkipper { } private _isNodeInternal(url: string, nodeInternals: ReadonlySet | undefined): boolean { + if (url.startsWith(node15InternalsPrefix)) { + return true; + } + return nodeInternals?.has(url) || /^internal\/.+\.js$/.test(url); }