-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Emit source positions for open/close braces #47924
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
Conversation
f6ad52d
to
07e8618
Compare
@typescript-bot perf test |
Heya @rbuckton, I've started to run the perf test suite on this PR at 07e8618. You can monitor the build here. Update: The results are in! |
@rbuckton Here they are:Comparison Report - main..47924
System
Hosts
Scenarios
Developer Information: |
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
src/compiler/emitter.ts
Outdated
@@ -455,6 +455,7 @@ namespace ts { | |||
inlineSourceMap: compilerOptions.inlineSourceMap, | |||
extendedDiagnostics: compilerOptions.extendedDiagnostics, | |||
onlyPrintJsDocStyle: true, | |||
omitBraceSourcePositions: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this name more obviously about source maps? I think most people dealing with the emitter API have .js/.d.ts emit in their minds, where this name makes no sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change the name, though this property is marked /*@internal*/
so it shouldn't impact API consumers outside of our own team.
07e8618
to
edc34e8
Compare
@rbuckton I'm going through all the ready-to-merge PRs, and this one is all signed off. Is it worth bringing up to date and merging it for 5.1? |
@rbuckton Same question as before, but for 5.3 -- should we take this one or close it? |
I'll see if I can get it up to date. |
This changes the emitter to emit source positions before and after open and close braces (
{
,}
) so that tools likev8-to-istanbul
can correctly map branches for code coverage. Brace source positions are ignored when the output is a declaration file.NOTE: This does not emit source positions for all tokens that pass through
emitTokenWithComment
, as that significantly increases the size of the output.js.map
file.Fixes #39170