Skip to content
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

Unable to preview named import for ts with sourcemap #1383

Closed
liuxingbaoyu opened this issue Sep 2, 2022 · 4 comments · Fixed by #1481
Closed

Unable to preview named import for ts with sourcemap #1383

liuxingbaoyu opened this issue Sep 2, 2022 · 4 comments · Fixed by #1481
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Issues identified as good for first-time contributors

Comments

@liuxingbaoyu
Copy link
Contributor

liuxingbaoyu commented Sep 2, 2022

Describe the bug
When debugging ts files with source maps, named imported variables are not previewed properly.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/liuxingbaoyu/jsdebug-sourcemap-bug
  2. yarn / npm i
  3. set breakpoint at src\util\scope.ts L18
  4. start debugging Launch Program
  5. preview BIND_SCOPE_LEXICAL
  6. see error

**VS Code Version: 1.71.0 (user setup)

Additional context
image
image

@liuxingbaoyu liuxingbaoyu added the bug Issue identified by VS Code Team member as probable bug label Sep 2, 2022
@connor4312
Copy link
Member

This is a result of how TS emits its names, not something the debugger controls.

@connor4312 connor4312 added the *out-of-scope Posted issue is not in scope of VS Code label Sep 3, 2022
@liuxingbaoyu
Copy link
Contributor Author

Thanks for the quick reply, I'll look into the source map.

@liuxingbaoyu
Copy link
Contributor Author

liuxingbaoyu commented Oct 6, 2022

I've re-investigated and this seems to be something the debugger can fix.

As a simple test, I modified https://github.com/microsoft/vscode-js-debug/blob/main/src/common/sourceMaps/renameProvider.ts#L21 to const identifierRe = /[$a -z_][$0-9A-Z_$]*.?[$0-9A-Z_$]*/iy;, it works fine.

image

image

@connor4312 connor4312 reopened this Oct 6, 2022
@connor4312
Copy link
Member

The identifierRe is pretty strict because the sourcemap only gives us where a name starts, not the length of it. But I think including . in that should be fine.

@connor4312 connor4312 added good first issue Issues identified as good for first-time contributors bug Issue identified by VS Code Team member as probable bug and removed bug Issue identified by VS Code Team member as probable bug *out-of-scope Posted issue is not in scope of VS Code labels Oct 6, 2022
@connor4312 connor4312 added this to the December 2022 milestone Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Issues identified as good for first-time contributors
Projects
None yet
2 participants