diff --git a/CHANGELOG.md b/CHANGELOG.md index 298b764ea..df14a2174 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,11 @@ Code v1.141.0 workbench storage on the remote server instead of browser storage. Use this if you want to share storage between multiple devices. +### Fixed + +- The Typescript extension was trying to load as a browser extension even though + we build the remote server version, causing it to fail to activate. + ### Changed - Update to Code 1.141.0 diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index a7db93a1a..c38b0ae22 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -58,10 +58,17 @@ main() { exit 1 fi - # Add the date, our name, links, enable telemetry (this just makes telemetry - # available; telemetry can still be disabled by flag or setting), and - # configure trusted extensions (since some, like github.copilot-chat, never - # ask to be trusted and this is the only way to get auth working). + # Modify the product.json: + # - Add the date + # - Set the code-server name. + # - Add our links + # - Enable telemetry (this just makes telemetry available; telemetry can still + # be disabled by flag or setting) + # - Configure trusted extensions (since some, like github.copilot-chat, never + # ask to be trusted and this is the only way to get auth working). + # - Make Typescript server plugins run in the workspace. We build the remote + # server version, so there is no browser distribution, and this key is not + # added automatically. # # This needs to be done before building as Code will read this file and embed # it into the client-side code. @@ -103,6 +110,9 @@ main() { ], "aiConfig": { "ariaKey": "code-server" + }, + "extensionPointExtensionKind": { + "typescriptServerPlugins": ["workspace"] } } EOF diff --git a/test/e2e/typescript.test.ts b/test/e2e/typescript.test.ts new file mode 100644 index 000000000..78faad906 --- /dev/null +++ b/test/e2e/typescript.test.ts @@ -0,0 +1,17 @@ +import { promises as fs } from "fs" +import * as path from "path" +import { describe, test } from "./baseFixture" + +const args = ["--disable-workspace-trust"] + +describe("typescript extension", args, {}, () => { + test("should load as a workspace extension", async ({ codeServerPage }) => { + const dir = await codeServerPage.workspaceDir + const file = path.join(dir, "foo.ts") + await fs.writeFile(file, 'const n: number = "x"') + await codeServerPage.openFile(file) + + await codeServerPage.executeCommandViaMenus("Developer: Show Running Extensions") + codeServerPage.page.getByLabel("typescript-language-features").getByText("localhost:").waitFor() + }) +})