Skip to content

Editor integration

ty can be integrated with various editors to provide a seamless development experience.

VS Code

The Astral team maintains an official VS Code extension.

Install the ty extension from the VS Code Marketplace.

Then disable the language server from the Python extension by adding the following setting to your settings.json to avoid running two language servers:

{
  "python.languageServer": "None"
}

Neovim

For Neovim 0.10 or earlier (with nvim-lspconfig):

require('lspconfig').ty.setup({
  settings = {
    ty = {
      -- ty language server settings go here
    }
  }
})

For Neovim 0.11+ (with vim.lsp.config):

-- Optional: Only required if you need to update the language server settings
vim.lsp.config('ty', {
  settings = {
    ty = {
      -- ty language server settings go here
    }
  }
})

-- Required: Enable the language server
vim.lsp.enable('ty')

Zed

ty is included with Zed out of the box (no extension required), although the default primary LSP for Python is basedpyright.

You can enable ty and disable basedpyright by adding this to your settings.json file:

{
  "languages": {
    "Python": {
      "language_servers": [
        // Disable basedpyright and enable Ty, and otherwise
        // use the default configuration.
        "ty",
        "!basedpyright",
        "..."
      ]
    }
  }
}

You can override the ty executable Zed uses by setting lsp.ty.binary:

{
  "lsp": {
    "ty": {
      "binary": {
        "path": "/home/user/.local/bin/ty",
        "arguments": ["server"]
      }
    }
  }
}

More information in Zed's documentation.

PyCharm

Starting with version 2025.3, PyCharm users can enable native ty support in the settings:

  1. Go to Python | Tools | ty in the Settings dialog.

  2. Select the Enable checkbox.

  3. In the Execution mode setting, select how PyCharm should search for the executable:

    Interpreter mode: PyCharm searches for an executable installed in your interpreter. To install the ty package for the selected interpreter, click Install ty.

    Path mode: PyCharm searches for an executable in $PATH. If the executable is not found, you can specify the path by clicking the Browse... icon.

  4. Select which options should be enabled.

For more information, refer to PyCharm documentation.

Other editors

ty can be used with any editor that supports the language server protocol.

To start the language server, use the server subcommand:

ty server

Refer to your editor's documentation to learn how to connect to an LSP server.

Customize your experience

See the editor settings for more details on configuring the language server.