Skip to content

fix(typescript-language-service): tnb(tsgo) compatibility - #14

Draft
guyutongxue wants to merge 6 commits into
mainfrom
fix-tsgo-integration
Draft

guyutongxue wants to merge 6 commits into
mainfrom
fix-tsgo-integration

Conversation

@guyutongxue

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve compatibility between the GamingTS TypeScript language service plugin and TypeScript Native Bridge / tsgo by (1) patching how VS Code’s built-in TypeScript extension recognizes/handles gaming-ts + .gts, and (2) adjusting the plugin’s external-files behavior to avoid expensive project-wide overlay materialization in tsgo scenarios.

Changes:

  • Add a tsserver.js proxy generator that patches the workspace typescript.js at runtime to treat .gts as supported and to adjust tsgo project association behavior.
  • Patch VS Code’s TypeScript extension JS at load time and intercept child_process.spawn/fork to route tsserver.js launches through the proxy.
  • Update the TS language service plugin to compute imported .gts files (transitively) for external-files, with a special mode intended for Native Bridge / tsgo, plus add tests.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/vscode/src/tsserver_proxy.ts New tsserver proxy + TypeScript source patcher for .gts / tsgo behavior.
packages/vscode/src/patch.ts Extends the TS extension patching and rewrites tsserver launch paths to use the proxy.
packages/vscode/src/formatter.ts Prefixes Prettier config log output with [GamingTS].
packages/vscode/package.json Changes activation events and TypeScript server plugin contribution configuration.
packages/vscode/tests/tsserver_proxy.test.ts Tests for TypeScript source patching and proxy generation.
packages/typescript-language-service-plugin/tsconfig.json Switches module kind and makes config typecheck-only (noEmit).
packages/typescript-language-service-plugin/src/index.ts Wraps plugin factory to customize external-files behavior (incl. tsgo mode).
packages/typescript-language-service-plugin/src/external_files.ts New logic to discover imported/transitively imported .gts files.
packages/typescript-language-service-plugin/tests/external_files.test.ts Tests for imported .gts discovery logic, including “open files only” mode.
examples/local/consumer.ts Cleans up example import and removes global console override.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 23 to 25
"activationEvents": [
"onLanguage:gaming-ts"
"onLanguage"
],
Comment thread packages/typescript-language-service-plugin/src/index.ts
Comment thread packages/vscode/src/patch.ts
Comment thread packages/vscode/src/patch.ts
@guyutongxue
guyutongxue force-pushed the fix-tsgo-integration branch from 6b108dd to 96e060b Compare July 27, 2026 16:36

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants