Skip to content

Commit ee7ce24

Browse files
committed
Merge branch 'main' into jabaile/symbol-tweaks
2 parents ec6d025 + dd0254a commit ee7ce24

File tree

21,433 files changed

+1499017
-38413
lines changed

Some content is hidden

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

21,433 files changed

+1499017
-38413
lines changed
File renamed without changes.

.github/workflows/ci.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,34 @@ jobs:
101101
path: testdata/baselines/local
102102

103103
lint:
104-
runs-on: ubuntu-latest
104+
strategy:
105+
fail-fast: false
106+
matrix:
107+
include:
108+
- os: ubuntu-latest
109+
- os: windows-latest
110+
- os: macos-latest
111+
- os: ubuntu-latest
112+
name: 'noembed'
113+
noembed: true
114+
115+
name: lint (${{ matrix.name || matrix.os }})
116+
117+
runs-on: ${{ matrix.os }}
118+
105119
steps:
106120
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
107121
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
108122
- uses: ./.github/actions/setup-go
109123
with:
110-
cache-name: lint
124+
cache-name: lint${{ (matrix.noembed && '-noembed') || ''}}
111125

112126
- run: npm ci
113127

114128
- run: npx hereby install-tools
115-
- run: npx hereby lint
129+
- run: npx hereby lint ${NOEMBED_FLAG:+"$NOEMBED_FLAG"}
130+
env:
131+
NOEMBED_FLAG: ${{ (matrix.noembed && '--noembed') || '' }}
116132

117133
format:
118134
runs-on: ubuntu-latest
@@ -154,11 +170,8 @@ jobs:
154170
with:
155171
cache-name: tidy
156172

157-
- run: go mod tidy
158-
- run: go -C ./_tools mod tidy
159-
160-
- run: git add .
161-
- run: git diff --staged --exit-code --stat
173+
- run: go mod tidy -diff
174+
- run: go -C ./_tools mod tidy -diff
162175

163176
smoke:
164177
runs-on: ubuntu-latest
@@ -181,6 +194,16 @@ jobs:
181194
- run: ./built/local/tsgo -p ./_submodules/TypeScript/src/compiler --singleThreaded
182195
- run: ./built/local/tsgo -p ./_submodules/TypeScript/src/compiler
183196

197+
misc:
198+
runs-on: ubuntu-latest
199+
steps:
200+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
201+
- uses: ./.github/actions/setup-go
202+
with:
203+
cache-name: misc
204+
205+
- run: go -C ./_tools run ./cmd/checkmodpaths $PWD
206+
184207
required:
185208
runs-on: ubuntu-latest
186209
if: ${{ always() }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ dist
142142
*.dll
143143
*.so
144144
*.dylib
145+
*.wasm
145146

146147
# Test binary, built with `go test -c`
147148
*.test
@@ -186,3 +187,8 @@ custom-gcl.exe
186187
custom-gcl.hash
187188

188189
/built
190+
191+
# macOS Finder metadata
192+
.DS_Store
193+
194+
.idea

.vscode/launch.template.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@
1717
],
1818
"autoAttachChildProcesses": true,
1919
"preLaunchTask": "Watch for extension run"
20+
},
21+
{
22+
"name": "Launch submodule test",
23+
"type": "go",
24+
"request": "launch",
25+
"mode": "test",
26+
"program": "${workspaceFolder}/internal/testrunner",
27+
"args": [
28+
"-test.run",
29+
"TestSubmodule/${fileBasename}"
30+
]
2031
}
2132
]
2233
}

Herebyfile.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,13 @@ export const lint = task({
314314
run: async () => {
315315
await buildCustomLinter();
316316

317-
const lintArgs = ["run", "--sort-results"];
317+
const lintArgs = ["run", "--sort-results", "--show-stats"];
318318
if (isCI) {
319319
lintArgs.push("--timeout=5m");
320320
}
321+
if (defaultGoBuildTags.length) {
322+
lintArgs.push("--build-tags", defaultGoBuildTags.join(","));
323+
}
321324
if (options.fix) {
322325
lintArgs.push("--fix");
323326
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ To try the prototype LSP experience:
5353

5454
This will launch a new VS Code instance which uses the Corsa LS as the backend. If correctly set up, you should see "typescript-go" as an option in the Output pane:
5555

56-
![LSP Prototype Screenshot](ls-screenshot.png)
56+
![LSP Prototype Screenshot](.github/ls-screenshot.png)
5757

5858

5959
## What Works So Far?
@@ -92,7 +92,7 @@ Definitions:
9292
Long-term, we expect this repo is that its contents will be merged into `microsoft/TypeScript`.
9393
As a result, the repo and issue tracker for typescript-go will eventually be closed, so treat discussions/issues accordingly.
9494

95-
For a list of intentional changes with respect to Typescript 5.7, see CHANGES.md.
95+
For a list of intentional changes with respect to TypeScript 5.7, see CHANGES.md.
9696

9797
## Contributing
9898

_tools/cmd/checkmodpaths/main.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"io/fs"
6+
"os"
7+
"path/filepath"
8+
9+
"golang.org/x/mod/module"
10+
)
11+
12+
func main() {
13+
os.Exit(run())
14+
}
15+
16+
func run() int {
17+
if len(os.Args) != 2 {
18+
fmt.Println("Usage: checkmodpaths <path>")
19+
return 1
20+
}
21+
path, err := filepath.Abs(os.Args[1])
22+
if err != nil {
23+
fmt.Println("Error getting absolute path:", err)
24+
return 1
25+
}
26+
27+
var errors []error
28+
err = fs.WalkDir(os.DirFS(path), ".", func(p string, d fs.DirEntry, err error) error {
29+
if err != nil {
30+
return err
31+
}
32+
33+
if p == "." {
34+
return nil
35+
}
36+
37+
if p[0] == '.' || p[0] == '_' {
38+
if d.IsDir() {
39+
return fs.SkipDir
40+
}
41+
return nil
42+
}
43+
44+
if err := module.CheckFilePath(p); err != nil {
45+
errors = append(errors, fmt.Errorf("%s: %w", p, err))
46+
}
47+
48+
return nil
49+
})
50+
if err != nil {
51+
fmt.Println("Error walking the directory:", err)
52+
return 1
53+
}
54+
55+
if len(errors) > 0 {
56+
for _, err := range errors {
57+
fmt.Println(err)
58+
}
59+
return 1
60+
}
61+
62+
fmt.Println("All module paths are valid.")
63+
return 0
64+
}

_tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ go 1.24.0
44

55
require (
66
github.com/golangci/plugin-module-register v0.1.1
7+
golang.org/x/mod v0.23.0
78
golang.org/x/tools v0.30.0
89
gotest.tools/v3 v3.5.2
910
)
1011

1112
require (
1213
github.com/google/go-cmp v0.6.0 // indirect
13-
golang.org/x/mod v0.23.0 // indirect
1414
golang.org/x/sync v0.11.0 // indirect
1515
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//go:build !windows
2+
3+
package main
4+
5+
func enableVirtualTerminalProcessing() {}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
import (
4+
"golang.org/x/sys/windows"
5+
)
6+
7+
func enableVirtualTerminalProcessing() {
8+
h, err := windows.GetStdHandle(windows.STD_OUTPUT_HANDLE)
9+
if err != nil || h == windows.InvalidHandle {
10+
return
11+
}
12+
fileType, err := windows.GetFileType(h)
13+
if err != nil || fileType == windows.FILE_TYPE_CHAR {
14+
var mode uint32
15+
if err := windows.GetConsoleMode(h, &mode); err != nil {
16+
return
17+
}
18+
if mode&windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING == 0 {
19+
_ = windows.SetConsoleMode(h, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING)
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)