Fork of zed-extensions/pyrefly
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
zed-zippy[bot] c7e6c68d09
Update CI workflows to 3183c04 (#14)
This PR updates the CI workflow files from the main Zed repository
based on the commit
zed-industries/zed@3183c04515

The update includes a new version of the extension CLI which adds
validation for semantic token rules for languages

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-03-25 18:56:11 +00:00
.github/workflows Update CI workflows to 3183c04 (#14) 2026-03-25 18:56:11 +00:00
src Initial commit 2025-05-16 10:28:08 +02:00
.gitignore remove *.wasm 2025-05-16 10:30:17 +02:00
Cargo.lock Initial commit 2025-05-16 10:28:08 +02:00
Cargo.toml Initial commit 2025-05-16 10:28:08 +02:00
extension.toml add readme 2025-05-16 10:41:13 +02:00
LICENSE Initial commit 2025-05-16 10:28:08 +02:00
README.md add readme 2025-05-16 10:41:13 +02:00

Pyrefly Extension for Zed

This extension adds support for Pyrefly, a static type checker for Python, to Zed.

Installation

1. Install Pyrefly

pyrefly must be installed on your system, and available in your $PATH in order to use in Zed.

You can install Pyrefly globally on your system using uv

uv tool install pyrefly

See the Pyrefly documentation for other installation methods.

2. Install the Extension

Search for pyrefly in the Zed extensions panel and click to install.

Enable

Disable pyright (or other Python language servers) and enable pyrefly in your Zed settings:

{
  "languages": {
    "Python": {
      "language_servers": ["pyrefly", "!pyright", "!pylsp"]
    },
  }
}

Configure

Configure under lsp.pyrefly.settings as required.

The "binary" setting is optional. If not set, pyrefly will be searched for in your $PATH.

{
  "lsp": {
    "pyrefly": {
      "binary": {
        "path": ".venv/bin/pyrefly",
        "arguments": ["lsp"]
      },
      "settings": {
        "python": {
          "pythonPath": ".venv/bin/python"
        },
        "pyrefly": {
          "project_includes": ["src/**/*.py", "tests/**/*.py"],
          "project_excludes": ["**/.[!/.]*", "**/*venv/**"],
          "search_path": ["src"],
          "ignore_errors_in_generated_code": true
        }
      }
    }
  }
}

Configuration Options

Pyrefly offers a variety of configuration options, which can be specified in your Zed settings or in a pyrefly.toml or pyproject.toml file in your project:

  • project_includes: List of glob patterns for files to type check
  • project_excludes: List of glob patterns for files to exclude from type checking
  • search_path: Roots for import resolution
  • python_version: Python version to use for type checking
  • python_platform: Platform to use for type checking
  • ignore_errors_in_generated_code: Whether to ignore errors in generated code

For a complete list of configuration options, see the Pyrefly documentation.

Using with Virtual Environments

For virtual environments, specify your Python interpreter in your project settings (zed: open project settings):

{
  "lsp": {
    "pyrefly": {
      "settings": {
        "python": {
          "pythonPath": ".venv/bin/python"
        },
        "pyrefly": {
          "python_interpreter": ".venv/bin/python"
        }
      }
    }
  }
}

Learn More