Skip to content
FeedbackDashboard

Iterate locally with the Stainless Language Server

Set up the Stainless Language Server in your editor for real-time diagnostics, intelligent completions, and navigation in your Stainless config and OpenAPI spec.

The SDK Studio provides IntelliSense, diagnostics, and navigation tools for your Stainless projects. The Stainless Language Server brings these features to your local development environment.

Before you begin, ensure you have:

  • A code editor installed (VS Code, Cursor, Zed, Neovim, or any LSP-compatible editor)
  • A Stainless account
  • A Stainless project with configuration files

To use the Stainless Language Server, first install the Stainless CLI.

Install with Homebrew (recommended for macOS):

Terminal window
brew tap stainless-api/tap
brew install stl

Or with Go:

Terminal window
go install 'github.com/stainless-api/stainless-api-cli/cmd/stl@latest'

To verify the installation:

Terminal window
stl --version

The extension operates on Stainless workspaces. Initialize your workspace by running:

Terminal window
stl init

This creates a .stainless/workspace.json file:

✓ Created workspace configuration at .stainless/workspace.json

The extension uses this file to identify your Stainless workspace and provide language support for your configuration files.

Install the extension from the Visual Studio Code Marketplace, or search for “Stainless” in the Extensions view (Ctrl+Shift+X / Cmd+Shift+X).

VSCode Marketplace

After installing the extension, open a workspace containing Stainless configuration files. The extension activates automatically when it detects a .stainless/workspace.json file.

To verify the extension is working:

  1. Open a stainless.yaml or stainless.yml file in your workspace
  2. For VS Code and Cursor, check the status bar in the bottom right corner for the Stainless icon
Editor status bar showing the active Stainless extension indicator

The language server analyzes your Stainless config and OpenAPI spec in real-time, surfacing errors, warnings, and suggestions directly in your editor. This helps you catch issues before running a build.

Diagnostics demo showing real-time error detection in the Stainless config file

Use Go to definition (F12 or Cmd+Click) to jump directly from your Stainless config to schema definitions, parameters, and response types in your OpenAPI spec. Use Find all references (Shift+F12) to see everywhere a schema or endpoint is used across your config and spec files.

Go to definition demo showing navigation from config to OpenAPI spec schema definitions

Intelligent completions in your Stainless config

Section titled “Intelligent completions in your Stainless config”

The language server provides context-aware autocompletion to speed up editing. It suggests valid config options, endpoints, and schema names based on your OpenAPI spec.

Completions demo showing context-aware autocompletion suggestions in the Stainless config

Resolve diagnostics with one click using code actions. Common diagnostics have an Autofix option, and you can easily ignore any warning diagnostic.

Quick fix demo showing one-click code actions to resolve diagnostics

Codelenses appear inline in your OpenAPI spec to show which schemas and endpoints are configured in your Stainless config. This makes it easy to see at a glance how your API is represented in your SDKs.

Codelenses demo showing inline indicators in OpenAPI spec for configured schemas and endpoints

The language server automatically generates and updates your transformed OpenAPI spec in real-time as you edit your config. Learn more about transforms.