Skip to content

Commit 2122679

Browse files
committed
Merge branch 'main' into jabaile/symbol-baseline-fixes-but-always-host
2 parents 008ab55 + 3d33f0e commit 2122679

File tree

3,823 files changed

+258313
-75109
lines changed

Some content is hidden

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

3,823 files changed

+258313
-75109
lines changed

.dprint.jsonc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@
3939
},
4040
"exec": {
4141
"cwd": "${configDir}",
42-
"cacheKey": "4",
4342
"commands": [
44-
{ "command": "go tool mvdan.cc/gofumpt -lang=go1.25", "exts": ["go"] }
43+
{ "command": "go tool mvdan.cc/gofumpt", "exts": ["go"], "cacheKeyFiles": ["go.mod"] }
4544
]
4645
},
4746
"excludes": [
@@ -59,9 +58,9 @@
5958
// Note: if adding new languages, make sure settings.template.json is updated too.
6059
// Also, if updating typescript, update the one in package.json.
6160
"plugins": [
62-
"https://plugins.dprint.dev/typescript-0.95.9.wasm",
61+
"https://plugins.dprint.dev/typescript-0.95.11.wasm",
6362
"https://plugins.dprint.dev/json-0.20.0.wasm",
6463
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
65-
"https://plugins.dprint.dev/exec-0.5.1.json@492414e39dea4dccc07b4af796d2f4efdb89e84bae2bd4e1e924c0cc050855bf"
64+
"https://plugins.dprint.dev/exec-0.6.0.json@a054130d458f124f9b5c91484833828950723a5af3f8ff2bd1523bd47b83b364"
6665
]
6766
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
steps:
1919
- name: Install Go
2020
id: install-go
21-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
21+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
2222
with:
2323
go-version: ${{ inputs.go-version }}
2424
cache: false
@@ -39,15 +39,15 @@ runs:
3939
4040
- if: ${{ inputs.create != 'true' }}
4141
name: Restore Go modules
42-
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
42+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
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@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
50+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
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@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
61+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
6262
with:
6363
key: unused-key-${{ github.run_id }}
6464
restore-keys: ${{ steps.cache-info.outputs.lint-key }}-
@@ -114,15 +114,15 @@ runs:
114114

115115
- if: ${{ inputs.create == 'true' }}
116116
name: Save Go modules
117-
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
117+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
118118
with:
119119
key: ${{ steps.cache-info.outputs.modules-key }}
120120
path: |
121121
~/go/pkg/mod
122122
123123
- if: ${{ inputs.create == 'true' }}
124124
name: Save Go build cache
125-
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
125+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
126126
with:
127127
key: ${{ steps.cache-info.outputs.build-key }}-${{ github.run_id }}
128128
path: |
@@ -132,7 +132,7 @@ runs:
132132
133133
- if: ${{ inputs.create == 'true' }}
134134
name: Save golangci-lint cache
135-
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
135+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
136136
with:
137137
key: ${{ steps.cache-info.outputs.lint-key }}-${{ github.run_id }}
138138
path: ${{ env.GOLANGCI_LINT_CACHE }}

.github/copilot-instructions.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ Most of our development takes place in the `internal` directory, and most behavi
99

1010
Most development on the codebase is in Go.
1111
Standard Go commands and practices apply, but we primarily use a tool called `hereby` to build, run tests, and other tasks.
12-
Run `npx hereby --list` to see all available commands.
12+
Run `npx hereby --tasks` to see all available commands.
1313

1414
```sh
15-
npx hereby build # Build the project
15+
npx hereby build # Build the tsgo binary (not required for tests)
1616
npx hereby test # Run tests
1717
npx hereby format # Format the code
1818
npx hereby lint # Run linters
1919

2020
# To run a specific compiler test:
21-
go test -run='TestSubmodule/<test name>' ./internal/testrunner # For submodule tests in _submodules/TypeScript
22-
go test -run='TestLocal/<test name>' ./internal/testrunner # For local tests in testdata/tests/cases
21+
go test -run='TestSubmodule/<test name>' ./internal/testrunner # For pre-existing "submodule" tests in _submodules/TypeScript
22+
go test -run='TestLocal/<test name>' ./internal/testrunner # For new "local" tests created in testdata/tests/cases
2323
```
2424

25-
Always make sure code is formatted, linted, and tested before sending a pull request.
26-
25+
Always make sure code is formatted, linted, and tested before sending a pull request.
26+
2727
## Compiler Features, Fixes, and Tests
2828

2929
When fixing a bug or implementing a new feature, at least one minimal test case should always be added in advance to verify the fix.
@@ -56,10 +56,10 @@ export interface Person {
5656
function greet(person) {
5757
console.log(`Hello, ${person.name}!`);
5858
}
59-
```
60-
61-
**New compiler tests should always enable strict mode (`@strict: true`) unless the bug specifically involves non-strict mode behavior.**
62-
59+
```
60+
61+
**New compiler tests should always enable strict mode (`@strict: true`) unless the bug specifically involves non-strict mode behavior.**
62+
6363
Tests don't always need the above `@option`s specified, but they are common to specify or modify.
6464
Tests can be run with multiple settings for a given option by using a comma-separated list (e.g. `@option: settingA,settingB`).
6565
`@filename` is only required when a test has multiple files, or when writing a test for a single JavaScript file (where `allowJs` or `checkJs` is enabled).

.github/workflows/ci.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
build:
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
28-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
27+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2929
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
3030
- uses: ./.github/actions/setup-go
3131

@@ -44,8 +44,8 @@ jobs:
4444
extension:
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
48-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
47+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
48+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
4949
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
5050

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

105-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
105+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
106106
with:
107107
submodules: ${{ !matrix.config.no-submodules }}
108-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
108+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
109109
with:
110110
node-version: 'lts/*'
111111
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
@@ -142,7 +142,7 @@ jobs:
142142

143143
- run: git add .
144144

145-
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
145+
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
146146
if: ${{ always() && matrix.config.coverage && github.event_name != 'merge_group' }}
147147
with:
148148
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
@@ -191,8 +191,8 @@ jobs:
191191
TSGO_HEREBY_NOEMBED: ${{ (matrix.config.noembed && 'true') || 'false' }}
192192

193193
steps:
194-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
195-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
194+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
195+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
196196
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
197197
- uses: ./.github/actions/setup-go
198198
with:
@@ -214,8 +214,8 @@ jobs:
214214
format:
215215
runs-on: ubuntu-latest
216216
steps:
217-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
218-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
217+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
218+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
219219
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
220220
- uses: ./.github/actions/setup-go
221221

@@ -226,10 +226,10 @@ jobs:
226226
generate:
227227
runs-on: ubuntu-latest
228228
steps:
229-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
229+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
230230
with:
231231
submodules: true
232-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
232+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
233233
with:
234234
node-version: '>=22.16.0'
235235
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
@@ -251,7 +251,7 @@ jobs:
251251
tidy:
252252
runs-on: ubuntu-latest
253253
steps:
254-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
254+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
255255
- uses: ./.github/actions/setup-go
256256

257257
- run: go mod tidy -diff
@@ -260,10 +260,10 @@ jobs:
260260
smoke:
261261
runs-on: ubuntu-latest
262262
steps:
263-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
263+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
264264
with:
265265
submodules: true
266-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
266+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
267267
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
268268
- uses: ./.github/actions/setup-go
269269

@@ -288,18 +288,18 @@ jobs:
288288
misc:
289289
runs-on: ubuntu-latest
290290
steps:
291-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
291+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
299+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
300300
with:
301301
submodules: true
302-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
302+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
303303
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
304304
- uses: ./.github/actions/setup-go
305305

.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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
47+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4848

4949
# Initializes the CodeQL tools for scanning.
5050
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
51+
uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 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@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
61+
uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 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@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
75+
uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ 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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2020
with:
2121
submodules: true
22-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
22+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2323
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
2424
- uses: ./.github/actions/setup-go
2525
with:

.github/workflows/create-cache.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jobs:
3636
- run: git config --system core.longpaths true
3737
if: ${{ matrix.os == 'windows-latest' }}
3838

39-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
39+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4040
with:
4141
submodules: true
42-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
42+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
4343
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
4444

4545
- uses: ./.github/actions/setup-go

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing
2+
3+
## How to Build and Run
4+
5+
This repo uses [Go 1.25 or higher](https://go.dev/dl/), [Rust 1.85 or higher](https://www.rust-lang.org/tools/install), [Node.js with npm](https://nodejs.org/), and [`hereby`](https://www.npmjs.com/package/hereby).
6+
7+
For tests and code generation, this repo contains a git submodule to the main TypeScript repo pointing to the commit being ported.
8+
When cloning, you'll want to clone with submodules:
9+
10+
```sh
11+
git clone --recurse-submodules https://github.com/microsoft/typescript-go.git
12+
```
13+
14+
If you have already cloned the repo, you can initialize the submodule with:
15+
16+
```sh
17+
git submodule update --init --recursive
18+
```
19+
20+
With the submodule in place and `npm ci`, you can run tasks via `hereby`, similar to the TypeScript repo:
21+
22+
```sh
23+
hereby build # Build the tsgo binary (not required for tests)
24+
hereby test # Run tests
25+
hereby format # Format the code
26+
hereby lint # Run linters
27+
hereby install-tools # Install additional tools such as linters
28+
hereby generate # Generate all Go code (e.g. diagnostics, committed to repo)
29+
```
30+
31+
Additional tasks are a work in progress.
32+
33+
`hereby` is not required to work on the repo; the regular `go` tooling (e.g., `go build`, `go test ./...`) will work as expected.
34+
`hereby` tasks are provided as a convenience for those familiar with the TypeScript repo.
35+
36+
### Running `tsgo`
37+
38+
After running `hereby build`, you can run `built/local/tsgo`, which behaves mostly the same as `tsc`.
39+
40+
### LSP Server
41+
42+
To debug and run the VS Code extension without installing it globally:
43+
44+
* Run VS Code in the repo workspace (`code .`)
45+
* Copy `.vscode/launch.template.json` to `.vscode/launch.json`
46+
* <kbd>F5</kbd> (or `Debug: Start Debugging` from the command palette)
47+
48+
This will launch a new VS Code instance which uses the Corsa LS as the backend. If correctly set up, you should see "tsgo" in the status bar when a TypeScript or JavaScript file is open:
49+
50+
![LSP Server Screenshot](.github/ls-screenshot.png)

0 commit comments

Comments
 (0)