CARVIEW |
Select Language
HTTP/2 200
date: Sat, 19 Jul 2025 02:03:01 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/microsoft/TypeScript.git
etag: W/"2c4ccf9f2d4a808e1755d9e7e0d85a82"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=Y7NPl%2BA5fUPrh3QZbx9PkfyODHI6%2B%2FZHrFjhKYijawMHBhD4F2xjWxE%2F9gqg8PG8K84aV1PHHOLsII8BzaUZU98gK28XYNJcYu2I7ms7L90VE9f%2BLClLB0h2UGxp0kBlQzBQl%2B294m1UFgX%2BarcAaE7DN2ILQQJie6MmTVP0kh16DmcvINgNDxv9CG0xjw77KWNo1Awpsyh4oSmwL1YT3rDGF2NApW7DXeSXE12G2XguzCY%2BlEuX8jb1yTa%2BuJa0daTtXSDwgbEjOI5FfM%2FIbg%3D%3D--dqi0eoETJZ%2BdtcCk--JWFiQXKqY5id%2BaOnk3AoBg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1842601963.1752890579; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 02:02:59 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 02:02:59 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 980E:3CD03C:13740B:1DB38D:687AFCD2
Preserve newlines from original source when printing nodes from TextC… · microsoft/TypeScript@237ea52 · GitHub
Copy file name to clipboardExpand all lines: src/compiler/factoryPublic.ts
Copy file name to clipboardExpand all lines: src/harness/fourslashImpl.ts
Copy file name to clipboardExpand all lines: src/services/formatting/formatting.ts
Copy file name to clipboardExpand all lines: src/services/refactors/extractType.ts
Copy file name to clipboardExpand all lines: src/services/textChanges.ts
Copy file name to clipboardExpand all lines: tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.js
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit 237ea52
authored
Preserve newlines from original source when printing nodes from TextChanges (#36688)
* Allow emitter to write multiple newlines in node lists
* Progress
* Progress
* Fix recomputeIndentation
* Add tests, fix leading line terminator count
* Do a bit less work when `preserveNewlines` is off
* Fix accidental find/replace rename
* Restore some monomorphism
* Fix single line writer
* Fix other writers
* Revert "Fix other writers"
This reverts commit 21b0cb8.
* Revert "Fix single line writer"
This reverts commit e535e27.
* Revert "Restore some monomorphism"
This reverts commit e3ef427.
* Add equal position optimization to getLinesBetweenRangeEndAndRangeStart
* Add one more test
* Actually save the test file
* Rename preserveNewlines to preserveSourceNewlines
* Make ignoreSourceNewlines internal
* Optimize lines-between functions
* Add comment;
* Fix trailing line terminator count bug for function parameters
* Preserve newlines around parenthesized expressions
* Back to speculative microoptimizations, yay
* Don’t call getEffectiveLines during tsc emit at all1 parent 667f3b4 commit 237ea52Copy full SHA for 237ea52
File tree
Expand file treeCollapse file tree
24 files changed
+477
-137
lines changedFilter options
- src
- compiler
- harness
- services
- formatting
- refactors
- tests
- baselines/reference
- cases/fourslash
Expand file treeCollapse file tree
24 files changed
+477
-137
lines changed+158-85Lines changed: 158 additions & 85 deletions
Large diffs are not rendered by default.
src/compiler/factoryPublic.ts
Copy file name to clipboardExpand all lines: src/compiler/factoryPublic.ts+6Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3567 | 3567 |
| |
3568 | 3568 |
| |
3569 | 3569 |
| |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
3570 | 3576 |
| |
3571 | 3577 |
| |
3572 | 3578 |
| |
|
+24-6Lines changed: 24 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
409 | 409 |
| |
410 | 410 |
| |
411 | 411 |
| |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
412 | 420 |
| |
| 421 | + | |
413 | 422 |
| |
414 | 423 |
| |
415 |
| - | |
416 |
| - | |
| 424 | + | |
| 425 | + | |
417 | 426 |
| |
418 | 427 |
| |
419 | 428 |
| |
| |||
425 | 434 |
| |
426 | 435 |
| |
427 | 436 |
| |
428 |
| - | |
429 |
| - | |
430 |
| - | |
431 |
| - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
432 | 450 |
| |
433 | 451 |
| |
434 | 452 |
| |
|
+3-1Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3784 | 3784 |
| |
3785 | 3785 |
| |
3786 | 3786 |
| |
3787 |
| - | |
| 3787 | + | |
3788 | 3788 |
| |
3789 | 3789 |
| |
3790 | 3790 |
| |
| |||
5860 | 5860 |
| |
5861 | 5861 |
| |
5862 | 5862 |
| |
| 5863 | + | |
5863 | 5864 |
| |
5864 | 5865 |
| |
5865 | 5866 |
| |
| |||
6324 | 6325 |
| |
6325 | 6326 |
| |
6326 | 6327 |
| |
| 6328 | + | |
6327 | 6329 |
| |
6328 | 6330 |
| |
6329 | 6331 |
| |
|
+43-12Lines changed: 43 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3633 | 3633 |
| |
3634 | 3634 |
| |
3635 | 3635 |
| |
3636 |
| - | |
3637 |
| - | |
| 3636 | + | |
| 3637 | + | |
3638 | 3638 |
| |
3639 | 3639 |
| |
3640 | 3640 |
| |
| |||
3913 | 3913 |
| |
3914 | 3914 |
| |
3915 | 3915 |
| |
3916 |
| - | |
3917 |
| - | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
3918 | 3919 |
| |
3919 | 3920 |
| |
3920 | 3921 |
| |
3921 |
| - | |
| 3922 | + | |
3922 | 3923 |
| |
3923 | 3924 |
| |
3924 | 3925 |
| |
| |||
4743 | 4744 |
| |
4744 | 4745 |
| |
4745 | 4746 |
| |
4746 |
| - | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
4747 | 4751 |
| |
4748 | 4752 |
| |
4749 | 4753 |
| |
4750 | 4754 |
| |
4751 | 4755 |
| |
4752 | 4756 |
| |
4753 | 4757 |
| |
4754 |
| - | |
| 4758 | + | |
4755 | 4759 |
| |
4756 | 4760 |
| |
4757 | 4761 |
| |
4758 |
| - | |
| 4762 | + | |
| 4763 | + | |
| 4764 | + | |
| 4765 | + | |
| 4766 | + | |
| 4767 | + | |
| 4768 | + | |
| 4769 | + | |
| 4770 | + | |
| 4771 | + | |
4759 | 4772 |
| |
4760 | 4773 |
| |
4761 | 4774 |
| |
4762 | 4775 |
| |
4763 | 4776 |
| |
4764 | 4777 |
| |
4765 | 4778 |
| |
4766 |
| - | |
4767 |
| - | |
| 4779 | + | |
| 4780 | + | |
| 4781 | + | |
| 4782 | + | |
| 4783 | + | |
4768 | 4784 |
| |
4769 | 4785 |
| |
4770 |
| - | |
4771 |
| - | |
| 4786 | + | |
| 4787 | + | |
| 4788 | + | |
| 4789 | + | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + | |
| 4793 | + | |
| 4794 | + | |
| 4795 | + | |
| 4796 | + | |
| 4797 | + | |
| 4798 | + | |
| 4799 | + | |
| 4800 | + | |
| 4801 | + | |
| 4802 | + | |
4772 | 4803 |
| |
4773 | 4804 |
| |
4774 | 4805 |
| |
|
src/harness/fourslashImpl.ts
Copy file name to clipboardExpand all lines: src/harness/fourslashImpl.ts+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3306 | 3306 |
| |
3307 | 3307 |
| |
3308 | 3308 |
| |
3309 |
| - | |
| 3309 | + | |
3310 | 3310 |
| |
3311 | 3311 |
| |
3312 | 3312 |
| |
|
src/services/formatting/formatting.ts
Copy file name to clipboardExpand all lines: src/services/formatting/formatting.ts+5-5Lines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
73 |
| - | |
| 73 | + | |
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| |||
567 | 567 |
| |
568 | 568 |
| |
569 | 569 |
| |
570 |
| - | |
571 |
| - | |
| 570 | + | |
| 571 | + | |
572 | 572 |
| |
573 | 573 |
| |
574 | 574 |
| |
| |||
996 | 996 |
| |
997 | 997 |
| |
998 | 998 |
| |
999 |
| - | |
| 999 | + | |
1000 | 1000 |
| |
1001 | 1001 |
| |
1002 | 1002 |
| |
1003 | 1003 |
| |
1004 | 1004 |
| |
1005 | 1005 |
| |
1006 | 1006 |
| |
1007 |
| - | |
| 1007 | + | |
1008 | 1008 |
| |
1009 | 1009 |
| |
1010 | 1010 |
| |
|
src/services/refactors/extractType.ts
Copy file name to clipboardExpand all lines: src/services/refactors/extractType.ts+2-2Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
162 |
| - | |
| 162 | + | |
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
| |||
174 | 174 |
| |
175 | 175 |
| |
176 | 176 |
| |
177 |
| - | |
| 177 | + | |
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
|
src/services/textChanges.ts
Copy file name to clipboardExpand all lines: src/services/textChanges.ts+3-3Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
935 | 935 |
| |
936 | 936 |
| |
937 | 937 |
| |
938 |
| - | |
| 938 | + | |
939 | 939 |
| |
940 | 940 |
| |
941 | 941 |
| |
| |||
1064 | 1064 |
| |
1065 | 1065 |
| |
1066 | 1066 |
| |
1067 |
| - | |
1068 |
| - | |
| 1067 | + | |
| 1068 | + | |
1069 | 1069 |
| |
1070 | 1070 |
| |
1071 | 1071 |
| |
|
tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.js
Copy file name to clipboardExpand all lines: tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.js+2-1Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 |
| - | |
| 38 | + | |
| 39 | + | |
39 | 40 |
| |
40 | 41 |
| |
41 | 42 |
| |
|
You can’t perform that action at this time.
0 commit comments