-
Notifications
You must be signed in to change notification settings - Fork 293
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
Attempt to automatically de/reference symlinked files #776
Comments
Hi @connor4312. Is the VS Code team actively working or planning to work this issue? Do you have any insight on whether debugging works with NPM 7's workspaces? I would imagine projects that adopt workspaces might run into this same unbound breakpoint problem, but I have not yet had an opportunity to test it myself, so that's just my speculation for now. Hopefully I'll get some time to test that soon, though. |
Improved some behavior here -- see the linked commit message for details. I considered making --preserve-symlinks a default argument, which is still a decent option, but I would be concerned about breaking existing users' setups. Regarding microsoft/vscode#113283 (comment), I learned something new that, at least on macOS, you can never be "CD"'d into a symlinked path. This is a chrome that the shell provides, but the working directory provided to any launched application is the physical path. We could sort of get around this by using a different cwd if we see that the launched directory is linked, but this also subtly changes some Node module resolution behavior, so this is not a safe change: we will just advise that users avoid having a symlinked cwd. |
To verify, have a setup with symlinked files:
|
So if I set a breakpoint in if I just have |
@TylerLeonhardt this is expected since without |
Currently for Node we sometimes require people to pass
--preseve-symlinks
(and document this) since Node dereferences scripts it loads, which can cause file paths to not patch up.However we could also use
fs.realPath
to dereference them ourselves. Breakpoints should be applied in both places (since we won't know which is the right one ahead of time). Still need to figure out how to deal with loaded sources, however, since when a source loads we need to tell VS code the path it knows about rather than the real path.The text was updated successfully, but these errors were encountered: