Skip to content

Editor setup

The experimental language server applies typed-sql's inferred overlay before TypeScript checks the program. It provides exact query and downstream hovers, diagnostics, completion, definitions, quick fixes, schema reloads, and bounded project caches.

Install it in the application:

sh
pnpm add -D @typed-sql/language-server

The package contains its own pinned TypeScript preview process. It does not load the workspace's tsserver.js.

Zed

Install the native extension from the repository's editors/zed directory as a development extension, then configure typed-sql as the sole TypeScript server:

json
{
  "languages": {
    "TypeScript": {
      "language_servers": ["typed-sql", "!vtsls", "!typescript-language-server"]
    },
    "TSX": {
      "language_servers": ["typed-sql", "!vtsls", "!typescript-language-server"]
    }
  },
  "lsp": {
    "typed-sql": {
      "settings": {
        "configPath": "typed-sql.config.ts",
        "projectFile": "tsconfig.json",
        "nativePreview": true
      }
    }
  }
}

Do not run vtsls or typescript-language-server beside this proxy. An ordinary TypeScript server sees the safe declaration baseline Query<unknown> and can display a competing hover.

schemaPath is optional. When omitted, the server uses schema.file from the discovered config.

VS Code

The repository includes an experimental VS Code extension that bundles the typed-sql language client. Build and install the VSIX using the instructions in the packages/vscode package.

Other LSP clients

Start the installed server over standard input/output:

sh
pnpm exec typed-sql-language-server --stdio

Initialization settings accept:

json
{
  "configPath": "typed-sql.config.ts",
  "schemaPath": "src/generated/db/schema.json",
  "projectFile": "tsconfig.json",
  "nativePreview": true,
  "maxCacheEntries": 256,
  "maxWorkspaceFiles": 2000
}

Relative paths resolve from the LSP workspace root. Each workspace folder receives its own config, grammar, schema, TypeScript project, and bounded cache.

Released under the MIT License.