From 5352772f44e01022092e8f5b7495d09bcc59d8aa Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Thu, 30 Jul 2026 10:11:42 -0400 Subject: [PATCH] Declare support for TOML files Summary -- Related to astral-sh/ruff#26862. I copied the Markdown changes from #950. Closes https://github.com/astral-sh/ruff/issues/27088. Test Plan -- --- README.md | 3 ++- package.json | 5 ++++- src/common/utilities.ts | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5f5279bb..57d9c909 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ The extension ships with `ruff==0.16.0`. ## Usage Once installed in Visual Studio Code, `ruff` will automatically execute when you open or edit a -Python or Jupyter Notebook file. +Python or Jupyter Notebook file, or a Ruff configuration file (`pyproject.toml`, `ruff.toml`, or +`.ruff.toml`). If you want to disable Ruff, you can [disable this extension](https://code.visualstudio.com/docs/editor/extension-marketplace#_disable-an-extension) per workspace in Visual Studio Code. diff --git a/package.json b/package.json index 18523569..8ce815e8 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,10 @@ "onLanguage:markdown", "workspaceContains:*.py", "workspaceContains:*.ipynb", - "workspaceContains:*.md" + "workspaceContains:*.md", + "workspaceContains:**/pyproject.toml", + "workspaceContains:**/ruff.toml", + "workspaceContains:**/.ruff.toml" ], "main": "./dist/extension.js", "scripts": { diff --git a/src/common/utilities.ts b/src/common/utilities.ts index 43ca2924..e93d8d43 100644 --- a/src/common/utilities.ts +++ b/src/common/utilities.ts @@ -45,5 +45,6 @@ export function getDocumentSelector(): DocumentSelector { { scheme: "vscode-notebook-cell", language: "python" }, { scheme: "file", language: "markdown" }, { scheme: "untitled", language: "markdown" }, + { scheme: "file", pattern: "**/{pyproject.toml,ruff.toml,.ruff.toml}" }, ]; }