fix: remove query strings from sourcemapped URLs (#1253)
* fix: remove query strings from sourcemapped URLs Fixes https://github.com/microsoft/vscode-js-debug/issues/1225 Fixes https://github.com/microsoft/vscode/issues/147662 * chore: update windows vm image
This commit is contained in:
Родитель
0d435a1c81
Коммит
8401fe466b
|
@ -31,18 +31,8 @@ jobs:
|
|||
|
||||
- job: Windows
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
vmImage: windows-latest
|
||||
steps:
|
||||
- powershell: |
|
||||
# This step can be removed once Edge is included on the test VM image.
|
||||
# The download URI comes from: https://www.microsoftedgeinsider.com/en-us/download
|
||||
$InstallerDownloadURI = "https://go.microsoft.com/fwlink/?linkid=2084649&Channel=Canary&language=en&Consent=1"
|
||||
$InstallerExe = "$ENV:BUILD_ARTIFACTSTAGINGDIRECTORY\MicrosoftEdgeSetup.exe"
|
||||
Invoke-WebRequest -Uri $InstallerDownloadURI -OutFile $InstallerExe
|
||||
Start-Process $InstallerExe -Wait -ArgumentList '/silent /install'
|
||||
# Cleanup installer
|
||||
Remove-Item $InstallerExe
|
||||
displayName: Install Edge Canary
|
||||
- template: common-validation.yml
|
||||
variables:
|
||||
node_version: 14.18.3
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"**/.DS_Store": true,
|
||||
"**/.dynamic-testWorkspace": true,
|
||||
"**/.vscode-test": true,
|
||||
"**/demos": true,
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
|
|
|
@ -69,9 +69,6 @@ export class NodeSourcePathResolver extends SourcePathResolverBase<IOptions> {
|
|||
* @override
|
||||
*/
|
||||
public async urlToAbsolutePath({ url, map }: IUrlResolution): Promise<string | undefined> {
|
||||
// https://github.com/microsoft/vscode-js-debug/issues/529
|
||||
url = url.replace(/\?.+/, '');
|
||||
|
||||
url = this.normalizeSourceMapUrl(url);
|
||||
|
||||
// Allow debugging of externally loaded Node internals
|
||||
|
|
|
@ -179,6 +179,17 @@ export abstract class SourcePathResolverBase<T extends ISourcePathResolverOption
|
|||
// https://github.com/microsoft/vscode-js-debug/issues/1080#issuecomment-938200168
|
||||
url = url.replace(nullByteRe, '');
|
||||
|
||||
// While file paths on some systems can contain "?", this is rare (and, fun
|
||||
// fact, actually cause webpack compilation to fail.) Meanwhile, webpack
|
||||
// seems to have started adding query strings to its source URLs.
|
||||
// Except don't do this for Vue. Vue is special :(
|
||||
// https://github.com/microsoft/vscode/issues/147662#issuecomment-1108985029
|
||||
// https://github.com/microsoft/vscode-js-debug/issues/1225
|
||||
const queryStringStart = url.lastIndexOf('?');
|
||||
if (queryStringStart !== -1 && url.slice(queryStringStart - 4, queryStringStart) !== '.vue') {
|
||||
url = url.slice(0, queryStringStart);
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
allThreadsStopped : false
|
||||
description : Paused on debugger statement
|
||||
reason : pause
|
||||
threadId : <number>
|
||||
}
|
||||
<anonymous> @ ${workspaceFolder}/sourceQueryString/input.ts:1:1
|
|
@ -1108,4 +1108,12 @@ describe('breakpoints', () => {
|
|||
await waitForPause(p); // should skip foo and hit baz again
|
||||
p.assertLog();
|
||||
});
|
||||
|
||||
itIntegrates('ignores source url query string (#1225)', async ({ r }) => {
|
||||
const cwd = join(testWorkspace, 'sourceQueryString');
|
||||
const handle = await r.runScript(join(cwd, 'output.js'), { cwd });
|
||||
handle.load();
|
||||
await waitForPause(handle);
|
||||
handle.assertLog({ substring: true });
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
debugger;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbnB1dC50cz9oZWxsb3dvcmxkIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFRLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJkZWJ1Z2dlcjtcbiJdfQ==
|
Загрузка…
Ссылка в новой задаче