agentleFS
MicrosoftKnown publishermicrosoft/python-lsp-compare/.github/copilot-instructions.md

python-lsp-compare

Copilot instructions6 starsChanged 8 months agoMITView on GitHub

python-lsp-compare is a benchmark and regression harness for Python LSP servers. It downloads servers, runs LSP scenarios over stdio JSON-RPC, captures timing/payload metrics, and produces comparison reports. Pure Python, zero external dependencies. All source lives under src/python_lsp_compare/. Key modules and data flow: - **server_download.py** — Downloads servers from GitHub releases (ServerSpec) or installs into isolated venvs from PyPI (PypiServerSpec). Caches binaries under .python-lsp-compare/servers/. Version checks cached 24h in versions.json. Functions return tuple[Path, str] (executable path + version label). - **server_configs.py**…

  • Installs packages

The file

We split this copilot-instructions.md into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All source lives under src/python_lsp_compare/.

    line 11
  2. Very specific:

    No dev dependencies are required — tests use only stdlib unittest and pytest.

    line 59
  3. Very specific:

    Zero external dependencies: All HTTP downloads use urllib.request.

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Project Guidelines

Overview

python-lsp-compare is a benchmark and regression harness for Python LSP servers. It downloads servers, runs LSP scenarios over stdio JSON-RPC, captures timing/payload metrics, and produces comparison reports. Pure Python, zero external dependencies.

Architecture

All source lives under src/python_lsp_compare/. Key modules and data flow:

server_download.py  →  server_configs.py  →  runner.py  →  report_markdown.py
  (download/cache)     (ConfiguredServer)    (LSP I/O)     report_csv.py
                       server_versions.py
  • server_download.py — Downloads servers from GitHub releases (ServerSpec) or installs into isolated venvs from PyPI (PypiServerSpec). Caches binaries under .python-lsp-compare/servers/. Version checks cached 24h in versions.json. Functions return tuple[Path, str] (executable path + version label).
  • server_configs.py — ConfiguredServer dataclass wraps a server binary with its launch command, args, and optional version_label.
  • server_versions.py — Detects version info for reports. Uses version_label when present (downloaded servers), falls back to git for local dev builds.
  • runner.py — Starts LSP server processes, sends JSON-RPC over stdio, measures latency. Sends workspace/didChangeConfiguration after initialized (required by Pyright).
  • lsp_client.py / transport.py — Low-level LSP framing and JSON-RPC protocol.
  • cli.py — Entry point. Subcommands: run, run-servers, bench-servers, run-benchmark, render-report, list-scenarios, list-benchmarks, list-servers, download-servers.
  • report_markdown.py / report_csv.py — Render comparison tables from JSON results.
  • environments.py — Creates per-benchmark-suite .venv with suite requirements.
  • benchmark_suites.py — Discovers suites under benchmarks/ with config.json.
  • scenarios/ — Individual LSP test scenarios (hover, completion, etc.).

Servers

Four servers are benchmarked by default (defined in server_download.py):

ServerTypeNotes
PyrightServerSpec (GitHub release, Node.js)Needs node on PATH
TyServerSpec (GitHub release, native)
PyreflyServerSpec (GitHub release, native)Uses --indexing-mode lazy-blocking --build-system-blocking
pylsp-mypyPypiServerSpec (PyPI venv)Installs python-lsp-server + pylsp-mypy; hover/completion come from Jedi, only diagnostics from mypy

Build & Test

python -m venv .venv
pip install -e .                          # install in editable mode
python -m pytest tests/ -x -q            # run all tests (26 tests, ~15s)
python -m python_lsp_compare bench-servers  # full benchmark run (downloads servers if needed)

No dev dependencies are required — tests use only stdlib unittest and pytest.

Key Conventions

  • Zero external dependencies. All HTTP downloads use urllib.request. Do not add packages to dependencies in pyproject.toml.
  • Python 3.11+. Uses match statements, str | None unions, dataclasses.
  • Return tuples consistently. download_server() and install_pypi_server() return (path, version_label). All code paths (including cache-hit early returns) must return the same shape.
  • Server failures are informational. handle_run_servers and handle_bench_servers always return exit code 0. Individual server failures are logged but don't fail the overall run.
  • Benchmark results go to results/. The _update_latest_results() function also copies to latest-results/ for the committed snapshot.
  • No .python-lsp-compare/ in git. Server binaries and version caches live there but are gitignored.

File Layout

  • benchmarks/ — Benchmark suites (each has config.json, requirements.txt, src/)
  • configs/ — Example server config files for --config flag
  • results/ — Output directory (gitignored except latest-results/)
  • tools/ — Utility scripts (e.g. Pyright stdio launcher)
  • tests/ — Pytest tests; fixtures in tests/fixtures/

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.