Skip to content

Ruff: Fix all auto-fixable problems erroring out in VSCode #11744

@MadhavVij

Description

@MadhavVij

Error When Running Ruff: Fix all auto-fixable problems in VSCode

When running Ruff: Fix all auto-fixable problems in VSCode, I get an error:

Failed to apply Ruff fixes to the document. Please consider opening an issue with steps to reproduce.

Looking at the logs in Output/Ruff, the detailed error is:

2024-06-04 17:48:48.138 [info] ┐ruff_formatter::printer::Printer::print{}

2024-06-04 17:48:48.138 [info] ┘

2024-06-04 17:48:48.138 [info] [Trace - 5:48:48 PM] Received response 'textDocument/formatting - (30)' in 0ms.
2024-06-04 17:49:51.866 [info] [Trace - 5:49:51 PM] Sending request 'workspace/executeCommand - (31)'.
2024-06-04 17:49:51.866 [info]  166.145599s WARN ruff_server::session::index No settings available for vscode-userdata:/Users/<user_name>/Library/Application%20Support/Code/User/settings.json - falling back to default settings

2024-06-04 17:49:51.867 [info]  166.146100s ERROR ruff_server::server::api An error occurred with result ID 31: Document snapshot not available for vscode-userdata:/Users/<user_name>/Library/Application%20Support/Code/User/settings.json

I was able to find the original string in the code here, in case it helps resolving it:

.ok_or(anyhow::anyhow!("Document snapshot not available for {uri}",))

Keywords Searched

  • VSCode
  • Document
  • Snapshot

Version Information

  • ruff --version: ruff 0.4.7

Please let me know if you need any more information to help resolve this issue.

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