Skip to content

Commit c63a4e4

Browse files
committed
Merge branch 'main' into traceResolutions
2 parents 9d3f88d + e86ed12 commit c63a4e4

File tree

285 files changed

+2215
-2336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+2215
-2336
lines changed

.github/actions/setup-go/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ runs:
3939
4040
- if: ${{ inputs.create != 'true' }}
4141
name: Restore Go modules
42-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
42+
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
4343
with:
4444
key: ${{ steps.cache-info.outputs.modules-key }}
4545
path: |
4646
~/go/pkg/mod
4747
4848
- if: ${{ inputs.create != 'true' }}
4949
name: Restore Go build cache
50-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
50+
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
5151
with:
5252
key: unused-key-${{ github.run_id }}
5353
restore-keys: ${{ steps.cache-info.outputs.build-key }}-
@@ -58,7 +58,7 @@ runs:
5858
5959
- if: ${{ inputs.create != 'true' && inputs.lint-cache == 'true' }}
6060
name: Restore golangci-lint cache
61-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
61+
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
6262
with:
6363
key: unused-key-${{ github.run_id }}
6464
restore-keys: ${{ steps.cache-info.outputs.lint-key }}-
@@ -109,15 +109,15 @@ runs:
109109

110110
- if: ${{ inputs.create == 'true' }}
111111
name: Save Go modules
112-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
112+
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
113113
with:
114114
key: ${{ steps.cache-info.outputs.modules-key }}
115115
path: |
116116
~/go/pkg/mod
117117
118118
- if: ${{ inputs.create == 'true' }}
119119
name: Save Go build cache
120-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
120+
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
121121
with:
122122
key: ${{ steps.cache-info.outputs.build-key }}-${{ github.run_id }}
123123
path: |
@@ -127,7 +127,7 @@ runs:
127127
128128
- if: ${{ inputs.create == 'true' }}
129129
name: Save golangci-lint cache
130-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
130+
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
131131
with:
132132
key: ${{ steps.cache-info.outputs.lint-key }}-${{ github.run_id }}
133133
path: ${{ env.GOLANGCI_LINT_CACHE }}

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
build:
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2828
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2929
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
3030
- uses: ./.github/actions/setup-go
@@ -44,7 +44,7 @@ jobs:
4444
extension:
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
4848
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4949
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
5050

@@ -102,7 +102,7 @@ jobs:
102102
- run: git config --system core.longpaths true
103103
if: ${{ matrix.config.os == 'windows-latest' }}
104104

105-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
105+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
106106
with:
107107
submodules: ${{ !matrix.config.no-submodules }}
108108
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
@@ -191,7 +191,7 @@ jobs:
191191
TSGO_HEREBY_NOEMBED: ${{ (matrix.config.noembed && 'true') || 'false' }}
192192

193193
steps:
194-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
194+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
195195
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
196196
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
197197
- uses: ./.github/actions/setup-go
@@ -214,7 +214,7 @@ jobs:
214214
format:
215215
runs-on: ubuntu-latest
216216
steps:
217-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
217+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
218218
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
219219
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
220220
- uses: ./.github/actions/setup-go
@@ -226,7 +226,7 @@ jobs:
226226
generate:
227227
runs-on: ubuntu-latest
228228
steps:
229-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
229+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
230230
with:
231231
submodules: true
232232
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
@@ -251,7 +251,7 @@ jobs:
251251
tidy:
252252
runs-on: ubuntu-latest
253253
steps:
254-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
254+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
255255
- uses: ./.github/actions/setup-go
256256

257257
- run: go mod tidy -diff
@@ -260,7 +260,7 @@ jobs:
260260
smoke:
261261
runs-on: ubuntu-latest
262262
steps:
263-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
263+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
264264
with:
265265
submodules: true
266266
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
@@ -288,15 +288,15 @@ jobs:
288288
misc:
289289
runs-on: ubuntu-latest
290290
steps:
291-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
291+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
292292
- uses: ./.github/actions/setup-go
293293

294294
- run: go -C ./_tools run ./cmd/checkmodpaths $PWD
295295

296296
baselines:
297297
runs-on: ubuntu-latest
298298
steps:
299-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
299+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
300300
with:
301301
submodules: true
302302
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ jobs:
4444

4545
steps:
4646
- name: Checkout repository
47-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
4848

4949
# Initializes the CodeQL tools for scanning.
5050
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
51+
uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
5252
with:
5353
config-file: ./.github/codeql/codeql-configuration.yml
5454
# Override language selection by uncommenting this and choosing your languages
@@ -58,7 +58,7 @@ jobs:
5858
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5959
# If this step fails, then you should remove it and run the build manually (see below).
6060
- name: Autobuild
61-
uses: github/codeql-action/autobuild@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
61+
uses: github/codeql-action/autobuild@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
6262

6363
# ℹ️ Command-line programs to run using the OS shell.
6464
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -72,4 +72,4 @@ jobs:
7272
# make release
7373

7474
- name: Perform CodeQL Analysis
75-
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
75+
uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# You can define any steps you want, and they will run before the agent starts.
1717
# If you do not check out your code, Copilot will do this for you.
1818
steps:
19-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2020
with:
2121
submodules: true
2222
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0

.github/workflows/create-cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- run: git config --system core.longpaths true
4242
if: ${{ matrix.os == 'windows-latest' }}
4343

44-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
4545
with:
4646
submodules: true
4747
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0

NOTICE.txt

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,36 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
221221

222222
---------------------------------------------------------
223223

224+
github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2 - BSD-3-Clause
225+
226+
227+
Copyright 2010 The Go Authors
228+
Copyright 2011 The Go Authors
229+
Copyright 2016 The Go Authors
230+
Copyright 2018 The Go Authors
231+
Copyright 2020 The Go Authors
232+
Copyright 2021 The Go Authors
233+
Copyright 2022 The Go Authors
234+
Copyright 2023 The Go Authors
235+
Copyright 2024 The Go Authors
236+
Copyright (c) 2020 The Go Authors
237+
238+
Copyright (c) <year> <owner> . All rights reserved.
239+
240+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
241+
242+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
243+
244+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
245+
246+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
247+
248+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
249+
250+
---------------------------------------------------------
251+
252+
---------------------------------------------------------
253+
224254
golang.org/x/sync v0.16.0 - BSD-3-Clause AND LicenseRef-scancode-google-patent-license-golang
225255

226256

@@ -236,7 +266,7 @@ BSD-3-Clause AND LicenseRef-scancode-google-patent-license-golang
236266

237267
---------------------------------------------------------
238268

239-
golang.org/x/sys v0.34.0 - BSD-3-Clause AND LicenseRef-scancode-google-patent-license-golang
269+
golang.org/x/sys v0.35.0 - BSD-3-Clause AND LicenseRef-scancode-google-patent-license-golang
240270

241271

242272
Copyright 2009 The Go Authors
@@ -264,6 +294,21 @@ BSD-3-Clause AND LicenseRef-scancode-google-patent-license-golang
264294

265295
---------------------------------------------------------
266296

297+
golang.org/x/term v0.34.0 - BSD-3-Clause AND LicenseRef-scancode-google-patent-license-golang
298+
299+
300+
Copyright 2009 The Go Authors
301+
Copyright 2011 The Go Authors
302+
Copyright 2013 The Go Authors
303+
Copyright 2019 The Go Authors
304+
Copyright 2021 The Go Authors
305+
306+
BSD-3-Clause AND LicenseRef-scancode-google-patent-license-golang
307+
308+
---------------------------------------------------------
309+
310+
---------------------------------------------------------
311+
267312
golang.org/x/text v0.27.0 - BSD-3-Clause AND LicenseRef-scancode-google-patent-license-golang
268313

269314

cmd/tsgo/sys.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/microsoft/typescript-go/internal/tspath"
1212
"github.com/microsoft/typescript-go/internal/vfs"
1313
"github.com/microsoft/typescript-go/internal/vfs/osvfs"
14+
"golang.org/x/term"
1415
)
1516

1617
type osSys struct {
@@ -50,6 +51,19 @@ func (s *osSys) EndWrite() {
5051
// todo: revisit if improving tsc/build/watch unittest baselines
5152
}
5253

54+
func (s *osSys) WriteOutputIsTTY() bool {
55+
return term.IsTerminal(int(os.Stdout.Fd()))
56+
}
57+
58+
func (s *osSys) GetWidthOfTerminal() int {
59+
width, _, _ := term.GetSize(int(os.Stdout.Fd()))
60+
return width
61+
}
62+
63+
func (s *osSys) GetEnvironmentVariable(name string) string {
64+
return os.Getenv(name)
65+
}
66+
5367
func newSystem() *osSys {
5468
cwd, err := os.Getwd()
5569
if err != nil {

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ require (
99
github.com/peter-evans/patience v0.3.0
1010
github.com/zeebo/xxh3 v1.0.2
1111
golang.org/x/sync v0.16.0
12-
golang.org/x/sys v0.34.0
12+
golang.org/x/sys v0.35.0
13+
golang.org/x/term v0.34.0
1314
golang.org/x/text v0.27.0
1415
gotest.tools/v3 v3.5.2
1516
)

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
2828
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
2929
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
3030
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
31-
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
32-
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
31+
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
32+
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
33+
golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
34+
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
3335
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
3436
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
3537
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=

internal/checker/printer.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ func createPrinterWithRemoveCommentsOmitTrailingSemicolon(emitContext *printer.E
2222
}
2323

2424
func createPrinterWithRemoveCommentsNeverAsciiEscape(emitContext *printer.EmitContext) *printer.Printer {
25-
// TODO: NeverAsciiEscape support
26-
return printer.NewPrinter(printer.PrinterOptions{RemoveComments: true}, printer.PrintHandlers{}, emitContext)
25+
return printer.NewPrinter(printer.PrinterOptions{
26+
RemoveComments: true,
27+
NeverAsciiEscape: true,
28+
}, printer.PrintHandlers{}, emitContext)
2729
}
2830

2931
type semicolonRemoverWriter struct {
@@ -256,6 +258,7 @@ func (c *Checker) symbolToStringEx(symbol *ast.Symbol, enclosingDeclaration *ast
256258
sourceFile = ast.GetSourceFileOfNode(enclosingDeclaration)
257259
}
258260
var printer_ *printer.Printer
261+
// add neverAsciiEscape for GH#39027
259262
if enclosingDeclaration != nil && enclosingDeclaration.Kind == ast.KindSourceFile {
260263
printer_ = createPrinterWithRemoveCommentsNeverAsciiEscape(nodeBuilder.EmitContext())
261264
} else {

0 commit comments

Comments
 (0)