Skip to content

Workspace edits from ruff server commands occasionally fail in VS Code when operating on an yet-to-be-created file #11248

@snowsignal

Description

@snowsignal

Steps to reproduce:

  1. Disable VS Code auto-save.
  2. Add ALL to the select setting in the extension
  3. Create a new .py file, but don't save it yet.
  4. Add this code to the file:
import foo

def bar():
    unused = 4
  1. Using the command palette (Ctrl/Cmd+Shift+P), repeatedly run ruff.applyAutofix.
  2. The second time you run applyAutofix, you should see an error about a workspace edit that couldn't be applied.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingserverRelated to the LSP server

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions