Skip to content

Commit 11ff08e

Browse files
committed
Merge branch 'main' into jabaile/symbol-tweaks
2 parents b4dc48c + 75ece81 commit 11ff08e

File tree

11,508 files changed

+210180
-367974
lines changed

Some content is hidden

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

11,508 files changed

+210180
-367974
lines changed

.dprint.jsonc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"**/*-lock.json",
5151
"**/testdata",
5252
"_submodules/**",
53-
"**/*_generated.go",
5453
"internal/bundled/libs/**",
5554
"internal/lsp/lsproto/_generate/*.json",
5655
"internal/lsp/lsproto/_generate/metaModelSchema.mts",
@@ -60,9 +59,9 @@
6059
// Note: if adding new languages, make sure settings.template.json is updated too.
6160
// Also, if updating typescript, update the one in package.json.
6261
"plugins": [
63-
"https://plugins.dprint.dev/typescript-0.94.0.wasm",
62+
"https://plugins.dprint.dev/typescript-0.95.7.wasm",
6463
"https://plugins.dprint.dev/json-0.20.0.wasm",
65-
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm",
64+
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
6665
"https://plugins.dprint.dev/exec-0.5.1.json@492414e39dea4dccc07b4af796d2f4efdb89e84bae2bd4e1e924c0cc050855bf"
6766
]
6867
}

.github/workflows/ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ jobs:
176176
main: true
177177
- os: windows-latest
178178
skip: ${{ github.event_name == 'merge_group' }}
179-
- os: macos-latest
180-
skip: ${{ github.event_name == 'merge_group' }}
179+
# Skip macOS; we do not have any build tag'd files that require checking.
180+
# - os: macos-latest
181+
# skip: ${{ github.event_name == 'merge_group' }}
181182
- os: ubuntu-latest
182183
name: 'noembed'
183184
noembed: true
@@ -235,6 +236,8 @@ jobs:
235236
with:
236237
submodules: true
237238
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
239+
with:
240+
node-version: '>=22.16.0'
238241
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
239242
- uses: ./.github/actions/setup-go
240243
with:
@@ -247,6 +250,12 @@ jobs:
247250
- run: node ./internal/lsp/lsproto/_generate/fetchModel.mjs
248251
- run: node ./internal/lsp/lsproto/_generate/generate.mjs
249252

253+
- name: Remove all converted fourslash tests
254+
run: rm -rf internal/fourslash/tests/gen
255+
256+
- name: Regenerate fourslash tests
257+
run: npm run convertfourslash
258+
250259
- run: git add .
251260
- run: git diff --staged --exit-code --stat
252261

.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@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
51+
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
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@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
61+
uses: github/codeql-action/autobuild@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
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@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
75+
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Copilot Setup Steps'
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
7+
copilot-setup-steps:
8+
runs-on: ubuntu-latest
9+
10+
# Set the permissions to the lowest permissions possible needed for your steps.
11+
# Copilot will be given its own token for its operations.
12+
permissions:
13+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
14+
contents: read
15+
16+
# You can define any steps you want, and they will run before the agent starts.
17+
# If you do not check out your code, Copilot will do this for you.
18+
steps:
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
submodules: true
22+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
23+
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
24+
- uses: ./.github/actions/setup-go
25+
with:
26+
cache-name: copilot-setup-steps
27+
- run: npm i -g @playwright/[email protected]
28+
- run: npm ci
29+
# pull dprint caches before network access is blocked
30+
- run: npx hereby check:format || true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,5 @@ custom-gcl.hash
196196
!testdata/submoduleAccepted.txt
197197

198198
!NOTICE.txt
199+
200+
!internal/fourslash/_scripts/failingTests.txt

.vscode/launch.template.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@
4141
"-test.run",
4242
"TestSubmodule/${fileBasename}"
4343
]
44+
},
45+
{
46+
"name": "Launch fourslash test",
47+
"type": "go",
48+
"request": "launch",
49+
"mode": "test",
50+
"program": "${workspaceFolder}/internal/fourslash/gen/${fileBasename}"
4451
}
4552
]
4653
}

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{
1818
"label": "Watch",
1919
"type": "npm",
20-
"script": "build:watch",
20+
"script": "build:watch:debug",
2121
"group": "build",
2222
"presentation": {
2323
"panel": "dedicated",

Herebyfile.mjs

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ const { values: rawOptions } = parseArgs({
7575

7676
// We can't use parseArgs' strict mode as it errors on hereby's --tasks flag.
7777
/**
78-
* @typedef {{ [K in keyof T as {} extends Record<K, 1> ? never : K]: T[K] }} RemoveIndex<T>
79-
* @template T
80-
*/
81-
/**
82-
* @typedef {RemoveIndex<typeof rawOptions>} Options
78+
* @typedef {{ [K in keyof typeof rawOptions as {} extends Record<K, 1> ? never : K]: typeof rawOptions[K] }} Options
8379
*/
8480
const options = /** @type {Options} */ (rawOptions);
8581

@@ -107,9 +103,12 @@ const goBuildFlags = [
107103
];
108104

109105
/**
110-
* @type {<T>(fn: () => T) => (() => T)}
106+
* @template T
107+
* @param {() => T} fn
108+
* @returns {() => T}
111109
*/
112110
function memoize(fn) {
111+
/** @type {T} */
113112
let value;
114113
return () => {
115114
if (fn !== undefined) {
@@ -842,21 +841,20 @@ const mainNativePreviewPackage = {
842841
* @typedef {"win32" | "linux" | "darwin"} OS
843842
* @typedef {"x64" | "arm" | "arm64"} Arch
844843
* @typedef {"Microsoft400" | "LinuxSign" | "MacDeveloperHarden" | "8020" | "VSCodePublisher"} Cert
845-
* @typedef {`${OS}-${Exclude<Arch, "arm"> | "armhf"}`} VSCodeTarget
844+
* @typedef {`${OS | "alpine"}-${Exclude<Arch, "arm"> | "armhf"}`} VSCodeTarget
846845
*/
847846
void 0;
848847

849848
const nativePreviewPlatforms = memoize(() => {
850-
/** @type {[OS, Arch, Cert][]} */
849+
/** @type {[os: OS, arch: Arch, cert: Cert, alpine?: boolean][]} */
851850
let supportedPlatforms = [
852851
["win32", "x64", "Microsoft400"],
853852
["win32", "arm64", "Microsoft400"],
854-
["linux", "x64", "LinuxSign"],
853+
["linux", "x64", "LinuxSign", true],
855854
["linux", "arm", "LinuxSign"],
856-
["linux", "arm64", "LinuxSign"],
855+
["linux", "arm64", "LinuxSign", true],
857856
["darwin", "x64", "MacDeveloperHarden"],
858857
["darwin", "arm64", "MacDeveloperHarden"],
859-
// Alpine?
860858
// Wasm?
861859
];
862860

@@ -865,17 +863,32 @@ const nativePreviewPlatforms = memoize(() => {
865863
assert.equal(supportedPlatforms.length, 1, "No supported platforms found");
866864
}
867865

868-
return supportedPlatforms.map(([os, arch, cert]) => {
866+
return supportedPlatforms.map(([os, arch, cert, alpine]) => {
869867
const npmDirName = `native-preview-${os}-${arch}`;
870868
const npmDir = path.join(builtNpm, npmDirName);
871869
const npmTarball = `${npmDir}.tgz`;
872870
const npmPackageName = `@typescript/${npmDirName}`;
873-
/** @type {VSCodeTarget} */
874-
const vscodeTarget = `${os}-${arch === "arm" ? "armhf" : arch}`;
875-
const extensionDir = path.join(builtVsix, `typescript-native-preview-${vscodeTarget}`);
876-
const vsixPath = extensionDir + ".vsix";
877-
const vsixManifestPath = extensionDir + ".manifest";
878-
const vsixSignaturePath = extensionDir + ".signature.p7s";
871+
872+
/** @type {VSCodeTarget[]} */
873+
const vscodeTargets = [`${os}-${arch === "arm" ? "armhf" : arch}`];
874+
if (alpine) {
875+
vscodeTargets.push(`alpine-${arch === "arm" ? "armhf" : arch}`);
876+
}
877+
878+
const extensions = vscodeTargets.map(vscodeTarget => {
879+
const extensionDir = path.join(builtVsix, `typescript-native-preview-${vscodeTarget}`);
880+
const vsixPath = extensionDir + ".vsix";
881+
const vsixManifestPath = extensionDir + ".manifest";
882+
const vsixSignaturePath = extensionDir + ".signature.p7s";
883+
return {
884+
vscodeTarget,
885+
extensionDir,
886+
vsixPath,
887+
vsixManifestPath,
888+
vsixSignaturePath,
889+
};
890+
});
891+
879892
return {
880893
nodeOs: os,
881894
nodeArch: arch,
@@ -885,11 +898,7 @@ const nativePreviewPlatforms = memoize(() => {
885898
npmDirName,
886899
npmDir,
887900
npmTarball,
888-
vscodeTarget,
889-
extensionDir,
890-
vsixPath,
891-
vsixManifestPath,
892-
vsixSignaturePath,
901+
extensions,
893902
cert,
894903
};
895904
});
@@ -1040,6 +1049,7 @@ export const signNativePreviewPackages = task({
10401049
SignFileRecordList: [],
10411050
};
10421051

1052+
/** @type {{ path: string; unsignedZipPath: string; signedZipPath: string; notarizedZipPath: string; }[]} */
10431053
const macZips = [];
10441054

10451055
// First, sign the files.
@@ -1175,8 +1185,9 @@ export const packNativePreviewExtensions = task({
11751185
console.log("Version:", version);
11761186

11771187
const platforms = nativePreviewPlatforms();
1188+
const extensions = platforms.flatMap(({ npmDir, extensions }) => extensions.map(e => ({ npmDir, ...e })));
11781189

1179-
await Promise.all(platforms.map(async ({ npmDir, vscodeTarget, extensionDir: thisExtensionDir, vsixPath, vsixManifestPath, vsixSignaturePath }) => {
1190+
await Promise.all(extensions.map(async ({ npmDir, vscodeTarget, extensionDir: thisExtensionDir, vsixPath, vsixManifestPath, vsixSignaturePath }) => {
11801191
const npmLibDir = path.join(npmDir, "lib");
11811192
const extensionLibDir = path.join(thisExtensionDir, "lib");
11821193
await fs.promises.mkdir(extensionLibDir, { recursive: true });
@@ -1192,7 +1203,7 @@ export const packNativePreviewExtensions = task({
11921203

11931204
await fs.promises.copyFile("NOTICE.txt", path.join(thisExtensionDir, "NOTICE.txt"));
11941205

1195-
await $({ cwd: thisExtensionDir })`vsce package ${version} --pre-release --no-update-package-json --no-dependencies --out ${vsixPath} --target ${vscodeTarget}`;
1206+
await $({ cwd: thisExtensionDir })`vsce package ${version} --no-update-package-json --no-dependencies --out ${vsixPath} --target ${vscodeTarget}`;
11961207

11971208
if (options.forRelease) {
11981209
await $({ cwd: thisExtensionDir })`vsce generate-manifest --packagePath ${vsixPath} --out ${vsixManifestPath}`;
@@ -1211,10 +1222,12 @@ export const signNativePreviewExtensions = task({
12111222
}
12121223

12131224
const platforms = nativePreviewPlatforms();
1225+
const extensions = platforms.flatMap(({ npmDir, extensions }) => extensions.map(e => ({ npmDir, ...e })));
1226+
12141227
await sign({
12151228
SignFileRecordList: [
12161229
{
1217-
SignFileList: platforms.map(({ vsixSignaturePath }) => ({ SrcPath: vsixSignaturePath, DstPath: null })),
1230+
SignFileList: extensions.map(({ vsixSignaturePath }) => ({ SrcPath: vsixSignaturePath, DstPath: null })),
12181231
Certs: "VSCodePublisher",
12191232
},
12201233
],
@@ -1244,7 +1257,7 @@ export const installExtension = task({
12441257
throw new Error(`No platform found for ${process.platform}-${process.arch}`);
12451258
}
12461259

1247-
await $`${options.insiders ? "code-insiders" : "code"} --install-extension ${myPlatform.vsixPath}`;
1260+
await $`${options.insiders ? "code-insiders" : "code"} --install-extension ${myPlatform.extensions[0].vsixPath}`;
12481261
console.log(pc.yellowBright("\nExtension installed. ") + "To enable this extension, set:\n");
12491262
console.log(pc.whiteBright(` "typescript.experimental.useTsgo": true\n`));
12501263
console.log("To configure the extension to use built/local instead of its bundled tsgo, set:\n");

NOTICE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
264264

265265
---------------------------------------------------------
266266

267-
golang.org/x/sync v0.14.0 - BSD-3-Clause
267+
golang.org/x/sync v0.15.0 - BSD-3-Clause
268268

269269
Copyright 2009 The Go Authors.
270270

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Preview
66

7-
A preview build is available on npm as `@typescript/native-preview`.
7+
A preview build is available on npm as [`@typescript/native-preview`](https://www.npmjs.com/package/@typescript/native-preview).
88

99
```sh
1010
npm install @typescript/native-preview
@@ -84,7 +84,7 @@ This is still a work in progress and is not yet at full feature parity with Type
8484
| Type checking | done | Same errors, locations, and messages as TS5.8. Types printback in errors may display differently (in progress) |
8585
| JavaScript-specific inference and JS Doc | not ready | - |
8686
| JSX | done | - |
87-
| Declaration emit | not ready | Coming soon |
87+
| Declaration emit | in progress | Most common features are in place, but some edge cases and feature flags are still unhandled |
8888
| Emit (JS output) | in progress | `target: esnext` well-supported, other targets may have gaps |
8989
| Watch mode | prototype | Watches files and rebuilds, but no incremental rechecking |
9090
| Build mode / project references | not ready | - |

0 commit comments

Comments
 (0)