Skip to content

Zed is scanning thousands of Files making editor operations slow #32686

Open
@Damon0603

Description

@Damon0603

Summary

Zed scans thousands of files even when they match file_scan_exclusions, making reference/definition look‑ups noticeably slow.

Description

On a fresh Zed install, typical Python projects with a local .venv and other common build artefacts open fine, but the language analysis subsystem (Pyright + Ruff) quickly balloons to many thousands of files—even those inside paths that are explicitly excluded in file_scan_exclusions.

Because of this over‑eager indexing / analysis:

  • The “Analyzing X/Y files” toast often shows several‑thousand files instead of the few hundred that actually belong to the project.
  • Go to Definition, Find References, etc. routinely take 4‑10 s instead of sub‑second.

The issue reproduces both with and without a virtual‑env activated in the integrated terminal.

Steps to reproduce:

  1. Create a new folder demo-proj, add a small Python file (e.g. main.py with print("hi")).
  2. Create a local venv: python -m venv .venv or with uv and install something moderately large (pip install numpy).
  3. Open the folder in Zed  latest version (tested on macbook pro m4).
  4. Observe the file‑analysis counter climbing into the thousands and subsequent sluggish Go to Definition.

Expected Behavior:
Only project‑relevant files (and their stubs) are analyzed; navigation actions complete should be really fast..

Actual Behavior:
Zed traverses and analyzes many files that match the exclusion globs, I assume in the (e.g. .venv/**, __pycache__/, .pytest_cache/) directories, causing seconds‑long delays.

settings.json
{
  "file_scan_exclusions": [
    "**/.git",
    "**/.svn",
    "**/.hg",
    "**/.jj",
    "**/CVS",
    "**/.DS_Store",
    "**/Thumbs.db",
    "**/.classpath",
    "**/.settings",
    ".ropeproject",
    "__pycache__",
    "*.idea",
    "*.ruff_cache",
    ".vscode",
    "*.cursor",
    "*.git",
    "*.pytest_cache",
    "*.DS_Store",
    "*.venv",
    "*.lock"
  ],
  "languages": {
    "Python": {
      "language_servers": ["pyright", "ruff"],
      "format_on_save": "on"
    }
  },
  "lsp": {
    "pyright": {
      "settings": {
        "python.analysis": {
          "diagnosticMode": "workspace",
          "exclude": [
            "**/node_modules",
            "**/__pycache__",
            "src/experimental",
            "src/typestubs"
          ]
        },
        "python": { "pythonPath": ".venv/bin/python" }
      }
    }
  }
}
Image

Zed Version and System Specs

Zed: v0.190.5 (Zed)
OS: macOS 15.5.0
Memory: 18 GiB
Architecture: aarch64

Metadata

Metadata

Assignees

No one assigned

    Labels

    pythonPython programming language support

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions