From 953acb0f6defb2c6e9bd01e5a899538b358b7c84 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Tue, 7 May 2024 14:40:34 -0400 Subject: [PATCH] Document configuring pyright for pyproject.toml (#11508) Release Notes: - N/A --- docs/src/languages/python.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/src/languages/python.md b/docs/src/languages/python.md index 0f1f7c823f9f881ed85d8b918740a17a625af1f0..4f3ff2be2cf6ddec9d0a7372623e5de90ba58518 100644 --- a/docs/src/languages/python.md +++ b/docs/src/languages/python.md @@ -38,6 +38,14 @@ Having done that, you would create a `pyrightconfig.json` with the following con } ``` +If you prefer to use a `pyproject.toml` file, you can add the following section: + +```toml +[tool.pyright] +venvPath = "." +venv = ".venv" +``` + ### Code formatting The Pyright language server does not provide code formatting. If you want to automatically reformat your Python code when saving, you'll need to specify an \_external_code formatter in your settings. See the [configuration](../configuring_zed.md) documentation for more information.