Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Effect-TS/tsgo/llms.txt

Use this file to discover all available pages before exploring further.

effect-tsgo is a drop-in replacement for tsgo (the TypeScript-Go binary). Any editor that supports TypeScript via tsserver can use it. You configure your editor to point at the effect-tsgo binary instead of the standard TypeScript language server.
Use effect-tsgo instead of tsgo, not alongside it. Running both in parallel produces duplicate diagnostics and degrades editor performance.

Get the binary path

Before configuring your editor, find the path to the effect-tsgo binary:
npx @effect/tsgo get-exe-path
This prints the absolute path to the effect-tsgo executable for your platform. Copy this path — you will need it in your editor config.

Patch @typescript/native-preview

Some editors (VS Code with the TypeScript-Go extension, for example) locate the TypeScript-Go binary through the @typescript/native-preview npm package. The patch command replaces that binary with effect-tsgo:
npx @effect/tsgo patch
What patch does:
  1. Locates the tsgo binary inside @typescript/native-preview in your project’s node_modules.
  2. Renames it to tsgo.original (backup).
  3. Copies the effect-tsgo binary into its place.
  4. Sets executable permissions.
  5. Runs a quick verification to confirm the binary starts correctly.
Re-run npx @effect/tsgo patch after upgrading @effect/tsgo to keep the binary in sync.

Restore the original binary

To undo the patch and restore the original tsgo binary:
npx @effect/tsgo unpatch
This restores tsgo.original back to tsgo and renames the patched binary out of the way.

VS Code

If you use the TypeScript Native Preview VS Code extension, VS Code automatically picks up the tsgo binary from @typescript/native-preview. After patching, effect-tsgo is already in place — no further configuration is needed.
1

Install the extension

Install the TypeScript Native Preview extension from the VS Code marketplace.
2

Install @typescript/native-preview

npm install --save-dev @typescript/native-preview
3

Patch the binary

npx @effect/tsgo patch
4

Reload VS Code

Reload the VS Code window (Developer: Reload Window from the command palette) to pick up the new binary.

Enabling project-wide diagnostics in VS Code

The setup wizard (npx @effect/tsgo setup) adds the following to your .vscode/settings.json to enable project-wide background diagnostics:
// .vscode/settings.json
{
  "typescript.tsserver.experimental.enableProjectDiagnostics": true
}
This causes VS Code to report diagnostics for all files in the project, not just open files.
The exact VS Code TypeScript-Go integration settings may evolve as the TypeScript Native Preview extension matures. Check the extension’s documentation for the latest configuration keys.

Neovim

Neovim users can configure effect-tsgo as the TypeScript language server using nvim-lspconfig (with or without Mason).

With Mason

If you use Mason, install effect-tsgo manually (Mason does not yet have a built-in package for it). Then register it as a custom server:
-- In your Neovim config (e.g., init.lua or a plugin file)
local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")

if not configs.effect_tsgo then
  configs.effect_tsgo = {
    default_config = {
      -- Replace with the output of: npx @effect/tsgo get-exe-path
      cmd = { "/path/to/effect-tsgo", "lsp" },
      filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
      root_dir = lspconfig.util.root_pattern("tsconfig.json", "package.json"),
      settings = {},
    },
  }
end

lspconfig.effect_tsgo.setup({})

Without Mason

If you manage LSP configs directly, add effect-tsgo alongside (or instead of) your existing tsserver or ts_ls setup:
local lspconfig = require("lspconfig")

-- Disable the standard tsserver/ts_ls to avoid duplicate diagnostics
-- lspconfig.ts_ls.setup({})

lspconfig.effect_tsgo.setup({
  cmd = { "/path/to/effect-tsgo", "lsp" },
  filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
  root_dir = lspconfig.util.root_pattern("tsconfig.json", "package.json"),
})
Do not run effect-tsgo alongside a standard tsserver/ts_ls client for the same project. Disable or remove the standard TypeScript LSP client to avoid duplicate diagnostics.

Other editors

Any editor that supports the TypeScript language server protocol (tsserver) can use effect-tsgo. The general approach is:
  1. Get the binary path: npx @effect/tsgo get-exe-path
  2. In your editor’s TypeScript LSP configuration, set the TypeScript server executable to that path.
  3. Disable any other TypeScript LSP clients for the same project.

Zed

Zed’s TypeScript support can be directed to a custom binary. Refer to the Zed extensions documentation and set the TypeScript language server path to the output of npx @effect/tsgo get-exe-path.

Emacs (eglot or lsp-mode)

With eglot:
(add-to-list 'eglot-server-programs
             '((typescript-mode typescript-tsx-mode)
               "/path/to/effect-tsgo" "lsp"))
With lsp-mode, configure the TypeScript server command to point at the effect-tsgo binary.

CLI reference

All @effect/tsgo binary management commands:
CommandDescription
npx @effect/tsgo patchReplace the @typescript/native-preview binary with effect-tsgo
npx @effect/tsgo unpatchRestore the original @typescript/native-preview binary
npx @effect/tsgo get-exe-pathPrint the absolute path to the effect-tsgo executable
npx @effect/tsgo setupRun the interactive project setup wizard
npx @effect/tsgo configInteractively configure diagnostic severities in an existing tsconfig

Troubleshooting

  • Confirm the plugin is in your tsconfig.json under compilerOptions.plugins.
  • Confirm effect-tsgo (not standard tsserver) is the active language server in your editor.
  • Check that diagnosticSeverity in your plugin config is set to {} (not omitted entirely), which enables all rules at their defaults.
  • Reload or restart the language server after any config change.
You may be running both the TypeScript Native Preview extension and a standard TypeScript language server. Disable one of them. effect-tsgo covers all standard TypeScript functionality — you do not need both.
Make sure @typescript/native-preview is installed in your project:
npm install --save-dev @typescript/native-preview
Then re-run npx @effect/tsgo patch.
@effect/tsgo ships platform-specific binaries for: linux-x64, linux-arm64, linux-arm, darwin-x64, darwin-arm64, win32-x64, and win32-arm64. If your platform is not in this list, open an issue on GitHub.
For additional help, see the Troubleshooting guide.