-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breakpoints not mapping correct between TS and JS files despite absolute or relative sourceMaps #117211
Comments
Since linked paths are resolved, I recommend setting your Better automatic handling may come with microsoft/vscode-js-debug#776 |
@connor4312 - I have already attempted both of those changes My sourceRoot was set to the absolute path "/home/eli/GitHub/trunk" Any other debugging info I can provide to narrow down. I am happy to tweak our settings, just can't get anything that works. |
The problem is that Node will automatically resolve these symlinks, so the URL for scripts that gets reported from the runtime is, in the case of the log,
...instead of the path in your working directory. The debugger doesn't know these paths are equivalent--that's part of what the linked issue covers. But I think it would work if you (can know and pass) |
Still no dice. Tried through several incarnations of that outFiles to the actual path. Still no luck.
I am happy to wait for the eventual fix here. Or I might try some resolution step to just land everything in actual paths for this use case.
If you need anyone to test a potential fix let me know. Also happy to post a sample repo with the problem although it sounds like you are well versed on the issue.
…-Eli
________________________________
From: Connor Peet <notifications@github.com>
Sent: Monday, February 22, 2021 9:24 AM
To: microsoft/vscode <vscode@noreply.github.com>
Cc: Eli Schleifer <elischleifer@outlook.com>; Author <author@noreply.github.com>
Subject: Re: [microsoft/vscode] Breakpoints not mapping correct between TS and JS files despite absolute or relative sourceMaps (#117211)
"${workspaceFolder}/bazel-bin/trunk/vscode/**/*.js" - bazel-bin is is symlink to the bazel cache out directory.
The problem is that Node will automatically resolve these symlinks, so the URL for scripts that gets reported from the runtime is, in the case of the log,
file:///home/eli/.cache/bazel/_bazel_eli/6ab7f98a34b740eb8432b3beaaef9fee/execroot/trunk/bazel-out/k8-fastbuild/bin/trunk/vscode/extension.js
...instead of the path in your working directory. The debugger doesn't know these paths are equivalent--that's part of what the linked issue covers. But I think it would work if you (can know and pass) file:///home/eli/.cache/bazel/_bazel_eli/6ab7f98a34b740eb8432b3beaaef9fee/execroot/trunk/bazel-out/k8-fastbuild/bin/**/*.js in your outfiles, instead of what you do today.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#117211 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAJVCPWA52VLHHKPL64TAPTTAKHLVANCNFSM4YAAAUJQ>.
|
If it's easy for you to do, a sample repo wouldn't hurt so I can make sure your use case is handled. |
Steps to Reproduce:
extension.js
/home/eli/.cache/bazel/_bazel_eli/6ab7f98a34b740eb8432b3beaaef9fee/execroot/trunk/bazel-out/k8-fastbuild/bin/trunk/vscode/extension.js
extension.js.map
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../../../trunk/vscode/extension.ts"],....}
I have also tried with sourceMaps where I have set the sourceRoot in tsconfig to be an absolute path to avoid all the potential hiccups with a symlink
{"version":3,"file":"extension.js","sourceRoot":"/home/eli/GitHub/trunk/","sources":["trunk/vscode/extension.ts"],"....}
The basic hello world built with tsc directly with output directories directly below the source works without a problem. I can also attach debugger with debugger statement. I just want to be able to debug with the ts source code.
6 Launch .json looksl like this:
{
"name": "VS Code Extension Run",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/trunk/vscode",
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/bazel-bin/trunk/vscode/**/*.js"
],
"trace": true
}
....
"main": "../../bazel-bin/trunk/vscode/extension.js",
"contributes": {
"commands": [
{
"command": "trunk.helloWorld",
"title": "Hello World"
},
{
"command": "trunk.goodbye",
"title": "Goodbye"
}
]
},
I've attached trace log
vscode-debugadapter-a94b88df.json.gz
Yes. I disabled all installed extensions except the remote extension needed for SSH
The text was updated successfully, but these errors were encountered: