Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/common/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}" },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex says that this also registers Ruff as a TOML formatter but that fixing this is not simple and should be a follow-up. It also shouldn't prevent users from selecting/configuring an actual TOML formatter, it just shows Ruff as an additional option.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like the answer is yes, but Codex says that fix is back in ruff_server, not here. I'll see what that looks like.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the fix is in ruff_server.

];
}