Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
ae0b6e5
perf(tspath): optimize the fast path case for `ToFileNameLowerCase` (…
camc314 Aug 12, 2025
8e8766a
perf(tspath): optimize `hasRelativePathSegment` (#1569)
camc314 Aug 12, 2025
18bc220
Encode only libFile name instead of path to it in buildInfo (#1567)
sheetalkamat Aug 12, 2025
f6a78d6
Port --traceResolutions (#1537)
sheetalkamat Aug 12, 2025
aa3f9f3
Update deps (#1547)
jakebailey Aug 12, 2025
29b9b8a
Switch RecursionId to any (#1477)
jakebailey Aug 12, 2025
db12742
Print out test diff on failure in create-cache (#1572)
jakebailey Aug 12, 2025
1ee2ba9
Explain files port (#1566)
sheetalkamat Aug 12, 2025
3205d2e
Set completion item's text edit if optional replacement span and inse…
gabritto Aug 13, 2025
cc3d47d
Update to Go 1.25 (#1577)
jakebailey Aug 13, 2025
0faeeca
chore: fix some minor issues in comments (#1573)
youzichuan Aug 13, 2025
6e6df72
feat(packagejson): remove RWMutex contention in InfoCache with atomic…
camc314 Aug 13, 2025
c8f6ec5
Update to golangci-lint v2.4.0 (#1580)
jakebailey Aug 13, 2025
eb88029
perf(tspath): void []byte allocation in ToFileNameLowerCase (#1581)
camc314 Aug 14, 2025
73637ac
JSDoc completions (#1561)
gabritto Aug 14, 2025
0711420
Get node's children with `forEachChild` + scanner in signature help (…
gabritto Aug 14, 2025
1370201
Use go.mod ignore directive instead of postinstall (#1585)
jakebailey Aug 14, 2025
916b357
Fix getSymbolAtLocation for importCall (#1587)
sheetalkamat Aug 14, 2025
ae2bacc
Make signature help arg index handling more like Strada (#1586)
jakebailey Aug 14, 2025
72edb9e
Updatess to tsc tests (#1589)
sheetalkamat Aug 15, 2025
7ab0e65
Port object rest and spread transform (#1529)
weswigham Aug 15, 2025
fc59d1a
Fix package id string to contain sub module (#1592)
sheetalkamat Aug 15, 2025
28fe3d4
Fix a few symbol printing / node builder bugs (#1588)
jakebailey Aug 15, 2025
058cba4
Bump the github-actions group across 1 directory with 2 updates (#1597)
dependabot[bot] Aug 18, 2025
c57ff20
Port strada `debug` namespace, enable many debug assertions (#1593)
weswigham Aug 18, 2025
7f19f5b
Remove runtime.Breakpoint call (#1601)
jakebailey Aug 19, 2025
4ddea0c
Fix typo in isRequiredInitializedParameter (#1598)
weswigham Aug 19, 2025
809b2c0
Const enum inlining and synthetic comment emit support (#1599)
weswigham Aug 19, 2025
5d54ac8
Prefer implicit `{}` over explicitly declared `{}` in subtype reducti…
ahejlsberg Aug 19, 2025
2c91932
Fix addUndefinedForParameter check location (#1606)
jakebailey Aug 19, 2025
d604acb
Add missing calls to AddSyntheticLeadingComment in node builder (#1607)
jakebailey Aug 19, 2025
2230db5
Update libsyncrpc (#1613)
jakebailey Aug 19, 2025
3a82d57
Compute referencedBy when its needed (#1608)
sheetalkamat Aug 20, 2025
3f675f1
Always set synthetic position when deep cloning (#1610)
gabritto Aug 20, 2025
bca9518
Don't error on referenced project's noEmit if program has empty files…
gabritto Aug 21, 2025
a6bad90
Snapshot LSP (#1505)
andrewbranch Aug 21, 2025
7fbbe04
Build mode (#1484)
sheetalkamat Aug 21, 2025
6ca9119
Refactor to use reflect.TypeAssert (#1621)
cuiweixie Aug 22, 2025
15ae26c
Release program after finishing program emit, Only cache dts and json…
sheetalkamat Aug 22, 2025
2391ab7
Fix copilot instructions using the wrong commands (#1620)
jakebailey Aug 22, 2025
41ced9a
Fix incorrect passing of compile times (#1626)
sheetalkamat Aug 22, 2025
e0df534
Update README with current status, move contributing related info to …
jakebailey Aug 22, 2025
7376eb2
Handle processing diagnostics similar to Strada (#1628)
gabritto Aug 25, 2025
a94299b
Fix three snapshots bugs (#1633)
andrewbranch Aug 25, 2025
99fc3d3
Make inferred project root files stable ordered (#1638)
andrewbranch Aug 26, 2025
d85436e
Pool collators in LS (#1582)
jakebailey Aug 26, 2025
bcb8510
Implement rename and improve find-all-references in LSP (#1635)
ahejlsberg Aug 27, 2025
52f2ee4
Snapshots: more logging, fix memory leak (#1641)
andrewbranch Aug 28, 2025
f89a64d
Fix panic recovery in server and fail test updater on unrecovered pan…
gabritto Aug 28, 2025
9955705
Fix signing for new release build pipeline (#1629)
jakebailey Aug 29, 2025
5d1d69a
Do not store include processing diagnsotics in buildInfo (#1643)
sheetalkamat Aug 29, 2025
1182233
autoimport completions (#1553)
iisaduan Aug 29, 2025
0a3c816
Fix error filtering by comment directives for program diagnostics (#1…
sheetalkamat Aug 30, 2025
71accec
fix(1650): [lsp] panic when hovering error in catch(error) (#1651)
a-tarasyuk Aug 31, 2025
d28e000
Fix BFS loop during config lookup (#1648)
gabritto Sep 2, 2025
cd1737d
[LSP] Fix panic autoimport completions when there are no lines above …
caumeira Sep 2, 2025
6eff055
autoimports nil dereference crash fix (#1665)
iisaduan Sep 2, 2025
1e359e7
fix(parser): panic when parsing JSDoc @satisfies with export assignme…
camc314 Sep 3, 2025
98d2daf
Don't use locale-aware sorting in completions (#1668)
gabritto Sep 3, 2025
4a5c3e2
clean up/fix incorrect switch statements (#1667)
iisaduan Sep 3, 2025
e8a0920
Fix porting bug in tsx completions (#1676)
gabritto Sep 4, 2025
545e075
Merge remote-tracking branch 'upstream/main' into guyllian.gomez/yarn…
arcanis Sep 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .custom-gcl.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/custom-gcl.jsonschema.json

version: v2.3.0
version: v2.4.0

destination: ./_tools

Expand Down
4 changes: 2 additions & 2 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"cwd": "${configDir}",
"cacheKey": "4",
"commands": [
{ "command": "go tool mvdan.cc/gofumpt -lang=go1.24", "exts": ["go"] }
{ "command": "go tool mvdan.cc/gofumpt -lang=go1.25", "exts": ["go"] }
]
},
"excludes": [
Expand All @@ -59,7 +59,7 @@
// Note: if adding new languages, make sure settings.template.json is updated too.
// Also, if updating typescript, update the one in package.json.
"plugins": [
"https://plugins.dprint.dev/typescript-0.95.8.wasm",
"https://plugins.dprint.dev/typescript-0.95.9.wasm",
"https://plugins.dprint.dev/json-0.20.0.wasm",
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
"https://plugins.dprint.dev/exec-0.5.1.json@492414e39dea4dccc07b4af796d2f4efdb89e84bae2bd4e1e924c0cc050855bf"
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Setup Go
inputs:
go-version:
description: Go version range to set up.
default: '>=1.24.0'
default: '>=1.25.0'
create:
description: Create the cache
default: 'false'
Expand Down Expand Up @@ -89,8 +89,13 @@ runs:

- if: ${{ inputs.create == 'true' }}
shell: bash
id: setup-go-test
run: npx hereby test

- if: ${{ failure() && inputs.create == 'true' && steps.setup-go-test.conclusion == 'failure' }}
shell: bash
run: git diff --diff-filter=AM --no-index ./testdata/baselines/reference ./testdata/baselines/local

- if: ${{ inputs.create == 'true' }}
shell: bash
run: npx hereby test --coverage
Expand Down
20 changes: 10 additions & 10 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ Most of our development takes place in the `internal` directory, and most behavi

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

```sh
npx hereby build # Build the project
npx hereby build # Build the tsgo binary (not required for tests)
npx hereby test # Run tests
npx hereby format # Format the code
npx hereby lint # Run linters

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

Always make sure code is formatted, linted, and tested before sending a pull request.

Always make sure code is formatted, linted, and tested before sending a pull request.
## Compiler Features, Fixes, and Tests

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.
Expand Down Expand Up @@ -56,10 +56,10 @@ export interface Person {
function greet(person) {
console.log(`Hello, ${person.name}!`);
}
```

**New compiler tests should always enable strict mode (`@strict: true`) unless the bug specifically involves non-strict mode behavior.**

```
**New compiler tests should always enable strict mode (`@strict: true`) unless the bug specifically involves non-strict mode behavior.**
Tests don't always need the above `@option`s specified, but they are common to specify or modify.
Tests can be run with multiple settings for a given option by using a comma-separated list (e.g. `@option: settingA,settingB`).
`@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).
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
- uses: ./.github/actions/setup-go
Expand All @@ -44,7 +44,7 @@ jobs:
extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable

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

- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: ${{ !matrix.config.no-submodules }}
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
TSGO_HEREBY_NOEMBED: ${{ (matrix.config.noembed && 'true') || 'false' }}

steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
- uses: ./.github/actions/setup-go
Expand All @@ -214,7 +214,7 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
- uses: ./.github/actions/setup-go
Expand All @@ -226,7 +226,7 @@ jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
Expand All @@ -251,7 +251,7 @@ jobs:
tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/actions/setup-go

- run: go mod tidy -diff
Expand All @@ -260,7 +260,7 @@ jobs:
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
Expand Down Expand Up @@ -288,15 +288,15 @@ jobs:
misc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/actions/setup-go

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

baselines:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

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

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
uses: github/codeql-action/analyze@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5
4 changes: 1 addition & 3 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ jobs:
# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
- uses: ./.github/actions/setup-go
with:
# Updated to 1.25.0-rc.1 to improve compilation time
go-version: '>=1.25.0-rc.1'
lint-cache: 'true'
- run: npm i -g @playwright/[email protected]
- run: npm ci
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/create-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,15 @@ jobs:
- windows-latest
- macos-latest
go-version:
- '>=1.24.0'

include:
# Temporary for the Copilot setup steps
- os: ubuntu-latest
go-version: '>=1.25.0-rc.1'
- '>=1.25.0'

runs-on: ${{ matrix.os }}

steps:
- run: git config --system core.longpaths true
if: ${{ matrix.os == 'windows-latest' }}

- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
Expand Down
50 changes: 50 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Contributing

## How to Build and Run

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).

For tests and code generation, this repo contains a git submodule to the main TypeScript repo pointing to the commit being ported.
When cloning, you'll want to clone with submodules:

```sh
git clone --recurse-submodules https://github.com/microsoft/typescript-go.git
```

If you have already cloned the repo, you can initialize the submodule with:

```sh
git submodule update --init --recursive
```

With the submodule in place and `npm ci`, you can run tasks via `hereby`, similar to the TypeScript repo:

```sh
hereby build # Build the tsgo binary (not required for tests)
hereby test # Run tests
hereby format # Format the code
hereby lint # Run linters
hereby install-tools # Install additional tools such as linters
hereby generate # Generate all Go code (e.g. diagnostics, committed to repo)
```

Additional tasks are a work in progress.

`hereby` is not required to work on the repo; the regular `go` tooling (e.g., `go build`, `go test ./...`) will work as expected.
`hereby` tasks are provided as a convenience for those familiar with the TypeScript repo.

### Running `tsgo`

After running `hereby build`, you can run `built/local/tsgo`, which behaves mostly the same as `tsc`.

### LSP Server

To debug and run the VS Code extension without installing it globally:

* Run VS Code in the repo workspace (`code .`)
* Copy `.vscode/launch.template.json` to `.vscode/launch.json`
* <kbd>F5</kbd> (or `Debug: Start Debugging` from the command palette)

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:

![LSP Server Screenshot](.github/ls-screenshot.png)
Loading