Skip to content

Commit ec6d025

Browse files
committed
Merge branch 'main' into jabaile/symbol-tweaks
2 parents d5c8f16 + 093107c commit ec6d025

File tree

10,340 files changed

+447583
-10064
lines changed

Some content is hidden

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

10,340 files changed

+447583
-10064
lines changed

.custom-gcl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/custom-gcl.jsonschema.json
22

3-
version: v1.63.4
3+
version: v1.64.6
44

55
destination: ./_tools
66

.dprint.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"cwd": "${configDir}",
4242
"cacheKey": "4",
4343
"commands": [
44-
{ "command": "gofumpt -lang=go1.23", "exts": ["go"] }
44+
{ "command": "gofumpt -lang=go1.24", "exts": ["go"] }
4545
]
4646
},
4747
"excludes": [

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Setup Go
44
inputs:
55
go-version:
66
description: Go version range to set up.
7-
default: '>=1.23.0'
7+
default: '>=1.24.0'
88
cache-name:
99
description: Name of scoped cache for this set up.
1010
default: 'cache'
@@ -20,12 +20,14 @@ runs:
2020
cache: false
2121

2222
- name: Go cache
23-
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
23+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
2424
with:
2525
# There is more code downloaded and built than is covered by '**/go.sum',
2626
# so give each job its own cache to try and not end up sharing the wrong
2727
# cache between jobs.
28-
key: ts-setup-go-${{ runner.os }}-${{ steps.install-go.outputs.go-version }}-${{ github.workflow }}-${{ inputs.cache-name }}-${{ hashFiles('**/go.sum', '**/Herebyfile.mjs', '**/.custom-gcl.yml') }}
28+
key: ts-setup-go-${{ runner.os }}-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/Herebyfile.mjs', '**/.custom-gcl.yml') }}-${{ github.workflow }}-${{ inputs.cache-name }}
29+
restore-keys: |
30+
ts-setup-go-${{ runner.os }}-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/Herebyfile.mjs', '**/.custom-gcl.yml') }}
2931
path: |
3032
~/go/pkg/mod
3133
~/.cache/go-build

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
npx hereby baseline-accept
9595
git add testdata/baselines/reference
9696
git diff --staged --exit-code
97-
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
97+
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
9898
if: ${{ failure() && steps.test.conclusion == 'failure' }}
9999
with:
100100
name: ${{ matrix.os }}-${{ (matrix.race && 'race') || 'norace' }}-new-baselines-artifact

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
# Initializes the CodeQL tools for scanning.
5050
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
51+
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
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@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
61+
uses: github/codeql-action/autobuild@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
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@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
75+
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ dist
145145

146146
# Test binary, built with `go test -c`
147147
*.test
148+
__debug_bin*
148149

149150
# Output of the go coverage tool, specifically when used with LiteIDE
150151
*.out

README.md

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
# typescript-go
1+
# TypeScript 7
22

3-
```console
4-
$ go run github.com/microsoft/typescript-go/cmd/tsgo@latest
5-
```
3+
[Not sure what this is? Read the announcement post!](https://devblogs.microsoft.com/typescript/typescript-native-port/)
64

7-
For a list of intentional changes with respect to Typescript 5.7, see CHANGES.md.
5+
This repo is very much under active development; as such there are no published artifacts at this time.
6+
Interested developers can clone and run locally to try out things as they become available.
87

9-
## Local development
8+
## How to Build and Run
109

11-
This repo uses Go and TypeScript. For a full development experience, you'll need to have both installed.
10+
This repo uses [Go 1.24 or higher](https://go.dev/dl/), [Node.js with npm](https://nodejs.org/), and [`hereby`](https://www.npmjs.com/package/hereby).
1211

1312
For tests and code generation, this repo contains a git submodule to the main TypeScript repo pointing to the commit being ported.
1413
When cloning, you'll want to clone with submodules:
@@ -39,6 +38,62 @@ Additional tasks are a work in progress.
3938
`hereby` is not required to work on the repo; the regular `go` tooling (e.g., `go build`, `go test ./...`) will work as expected.
4039
`hereby` tasks are provided as a convenience for those familiar with the TypeScript repo.
4140

41+
### Running `tsgo`
42+
43+
After running `hereby build`, you can run `built/local/tsgo`, which behaves mostly the same as `tsc` (respects tsconfig, but also prints out perf stats).
44+
This is mainly a testing entry point; for higher fidelity with regular `tsc`, run `tsgo tsc [flags]`, which behaves more similarly to `tsc`.
45+
46+
### Running LSP Prototype
47+
48+
To try the prototype LSP experience:
49+
50+
* Run VS Code in the repo workspace (`code .`)
51+
* Copy `.vscode/launch.template.json` to `.vscode/launch.json`
52+
* <kbd>F5</kbd> (or `Debug: Start Debugging` from the command palette)
53+
54+
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:
55+
56+
![LSP Prototype Screenshot](ls-screenshot.png)
57+
58+
59+
## What Works So Far?
60+
61+
This is still a work in progress and is not yet at full feature parity with TypeScript. Bugs may exist. Please check this list carefully before logging a new issue or assuming an intentional change.
62+
63+
Status overview:
64+
65+
* Program creation (read `lib`, `target`, `reference`, `import`, `files`, `include`, and `exclude`): **done**. You should see the *same files*, with modules resolved to the *same locations*, as in a TypeScript 5.8 (TS5.8) invocation
66+
* Not all resolution modes are supported yet
67+
* Parsing/scanning (read source text and determine syntax shape): **done**. You should see the exact same *syntax errors* as in a TS5.8 invocation
68+
* Commandline and `tsconfig.json` parsing: **mostly done**. Note that the entry point is slightly different (for now)
69+
* Type resolution (resolve computed types to a concrete internal representation): **done**. You should see the same types as in TS5.8
70+
* Type checking (check for problems in functions, classes, and statements): **done**. You should see the same errors, in the same locations, with the same messages, as TS 5.8
71+
* Types printback in errors may display slightly differently; this is in progress
72+
* JavaScript-specific inference and JS Doc: **not ready**
73+
* JSX: **not ready**
74+
* Declaration emit: **not ready**. Coming soon!
75+
* Emit (JS output): **in progress**. `target: esnext` (minimal downleveling) is well-supported but other targets may have gaps
76+
* Watch mode: **prototype** (watches the correct files and rebuilds, but doesn't do incremental rechecking)
77+
* Build mode / project references: **not ready**
78+
* Incremental build: **not ready**
79+
* Language service (LSP): **prototype** only, expect minimal functionality (errors, hover, go to def). More features soon!
80+
* ASCII files only for now
81+
* API: **not ready**
82+
83+
Definitions:
84+
85+
* **done** aka "believed done": We're not currently aware of any deficits or major left work to do. OK to log bugs
86+
* **in progress**: currently being worked on; some features may work and some might not. OK to log panics, but nothing else please
87+
* **prototype**: proof-of-concept only; do not log bugs
88+
* **not ready**: either haven't even started yet, or far enough from ready that you shouldn't bother messing with it yet
89+
90+
## Other Notes
91+
92+
Long-term, we expect this repo is that its contents will be merged into `microsoft/TypeScript`.
93+
As a result, the repo and issue tracker for typescript-go will eventually be closed, so treat discussions/issues accordingly.
94+
95+
For a list of intentional changes with respect to Typescript 5.7, see CHANGES.md.
96+
4297
## Contributing
4398

4499
This project welcomes contributions and suggestions. Most contributions require you to agree to a

_tools/customlint/testdata/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module testdata
22

3-
go 1.23.3
3+
go 1.24.0

_tools/go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module github.com/microsoft/typescript-go/_tools
22

3-
go 1.23.3
3+
go 1.24.0
44

55
require (
66
github.com/golangci/plugin-module-register v0.1.1
7-
golang.org/x/tools v0.27.1-0.20241128223349-e7bd2274d184
8-
gotest.tools/v3 v3.5.1
7+
golang.org/x/tools v0.30.0
8+
gotest.tools/v3 v3.5.2
99
)
1010

1111
require (
1212
github.com/google/go-cmp v0.6.0 // indirect
13-
golang.org/x/mod v0.22.0 // indirect
14-
golang.org/x/sync v0.9.0 // indirect
13+
golang.org/x/mod v0.23.0 // indirect
14+
golang.org/x/sync v0.11.0 // indirect
1515
)

_tools/go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+
22
github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc=
33
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
44
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
5-
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
6-
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
7-
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
8-
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
9-
golang.org/x/tools v0.27.1-0.20241128223349-e7bd2274d184 h1:wi4Jz8kRE1yU2JFOi7/w75M61R6mfyCS24FzCFKMuHI=
10-
golang.org/x/tools v0.27.1-0.20241128223349-e7bd2274d184/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=
11-
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
12-
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
5+
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
6+
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
7+
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
8+
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
9+
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
10+
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
11+
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
12+
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=

0 commit comments

Comments
 (0)