From 326d5d10ded30621fe982c49469d288f64e6982c Mon Sep 17 00:00:00 2001 From: flou Date: Wed, 31 Dec 2025 01:54:05 +0100 Subject: [PATCH] python: Add support for `uv run` as the shebang line (#45881) `uv run` can be used to specify a shebang for a Python script. See: https://docs.astral.sh/uv/guides/scripts/#using-a-shebang-to-create-an-executable-file Release Notes: - Added support for `uv run` in the shebang line to be interpreted as a Python script --- crates/languages/src/python/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/languages/src/python/config.toml b/crates/languages/src/python/config.toml index c58a54fc1c..d96a5ea5fe 100644 --- a/crates/languages/src/python/config.toml +++ b/crates/languages/src/python/config.toml @@ -1,7 +1,7 @@ name = "Python" grammar = "python" path_suffixes = ["py", "pyi", "mpy"] -first_line_pattern = '^#!.*\bpython[0-9.]*\b' +first_line_pattern = '^#!.*((\bpython[0-9.]*\b)|(\buv run\b))' line_comments = ["# "] autoclose_before = ";:.,=}])>" brackets = [