astral-sh / astral-sh/ruff-vscode

feat: LanguageModelTool API support

Open
#752 2 comments 2 reactions 0 assignees View on GitHub
needs-info
Dominant language
TypeScript
Stars
1.7k
Forks
80
Avg merge
8h 22m
Merged PRs (30d)
22

Description

When I'm using GitHub copilot in agent mode in VSCode, as it is writing files, I want these files to be run through `ruff`. A good start would just be `ruff format` so that everything is formatted correctly, but more advanced would be for `ruff lint` to work so that the model could then auto-apply the fixes. Just the formatting would be great though.

VSCode provides a [LanguageModelTool API for extensions](https://code.visualstudio.com/api/extension-guides/tools). If we added that to this extension, then ruff could advertise to the language model "hey, I have this tool that can format and lint code", and the language model would be able to choose to use it, and apply it automatically ("tool use").

What do you think of this idea?

Contributor guide

Open the contributing guide

Research direction

Read the linked VS Code LanguageModelTool API guide first, then inspect the extension's existing command and integration entry points. Define the smallest supported tool behavior around ruff format, and verify that VS Code can advertise and invoke it from Copilot agent mode before considering lint fixes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.