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

# Editor setup

> Configure VS Code, Neovim, and other tsserver-compatible editors to use the effect-tsgo binary as their TypeScript language server.

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

<Warning>
  Use `effect-tsgo` **instead of** `tsgo`, not alongside it. Running both in parallel produces duplicate diagnostics and degrades editor performance.
</Warning>

## Get the binary path

Before configuring your editor, find the path to the `effect-tsgo` binary:

```bash theme={null}
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`:

```bash theme={null}
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.

<Tip>
  Re-run `npx @effect/tsgo patch` after upgrading `@effect/tsgo` to keep the binary in sync.
</Tip>

### Restore the original binary

To undo the patch and restore the original `tsgo` binary:

```bash theme={null}
npx @effect/tsgo unpatch
```

This restores `tsgo.original` back to `tsgo` and renames the patched binary out of the way.

***

## VS Code

### Using `@typescript/native-preview` (recommended)

If you use the [TypeScript Native Preview](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.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.

<Steps>
  <Step title="Install the extension">
    Install the **TypeScript Native Preview** extension from the VS Code marketplace.
  </Step>

  <Step title="Install @typescript/native-preview">
    ```bash theme={null}
    npm install --save-dev @typescript/native-preview
    ```
  </Step>

  <Step title="Patch the binary">
    ```bash theme={null}
    npx @effect/tsgo patch
    ```
  </Step>

  <Step title="Reload VS Code">
    Reload the VS Code window (**Developer: Reload Window** from the command palette) to pick up the new binary.
  </Step>
</Steps>

### 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:

```jsonc theme={null}
// .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.

<Note>
  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.
</Note>

***

## 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](https://github.com/williamboman/mason.nvim), install `effect-tsgo` manually (Mason does not yet have a built-in package for it). Then register it as a custom server:

```lua theme={null}
-- 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:

```lua theme={null}
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"),
})
```

<Warning>
  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.
</Warning>

***

## 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](https://zed.dev/docs/extensions) and set the TypeScript language server path to the output of `npx @effect/tsgo get-exe-path`.

### Emacs (eglot or lsp-mode)

With `eglot`:

```emacs-lisp theme={null}
(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:

| Command                         | Description                                                           |
| ------------------------------- | --------------------------------------------------------------------- |
| `npx @effect/tsgo patch`        | Replace the `@typescript/native-preview` binary with `effect-tsgo`    |
| `npx @effect/tsgo unpatch`      | Restore the original `@typescript/native-preview` binary              |
| `npx @effect/tsgo get-exe-path` | Print the absolute path to the `effect-tsgo` executable               |
| `npx @effect/tsgo setup`        | Run the interactive project setup wizard                              |
| `npx @effect/tsgo config`       | Interactively configure diagnostic severities in an existing tsconfig |

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Diagnostics are not appearing">
    * 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.
  </Accordion>

  <Accordion title="Duplicate diagnostics in VS Code">
    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.
  </Accordion>

  <Accordion title="patch command fails">
    Make sure `@typescript/native-preview` is installed in your project:

    ```bash theme={null}
    npm install --save-dev @typescript/native-preview
    ```

    Then re-run `npx @effect/tsgo patch`.
  </Accordion>

  <Accordion title="My platform is not supported">
    `@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](https://github.com/Effect-TS/tsgo/issues).
  </Accordion>
</AccordionGroup>

For additional help, see the [Troubleshooting guide](/guides/troubleshooting).
