Summary
I'd like to propose adding virtual workspace support to ruff-vscode by exporting a registerUriTranslator API — the same pattern Pylance already uses.
Problem
The extension currently declares virtualWorkspaces.supported: false. This blocks Ruff from providing linting/formatting in virtual workspace environments (GitHub Repositories, Microsoft Fabric notebooks, custom FileSystemProvider workspaces).
No Python linter or formatter currently supports virtual workspaces (see microsoft/vscode-python#21459).
Proposed approach
Ruff exports registerUriTranslator(), the VFS provider owns the cache.
This is the exact pattern Pylance uses. The VFS provider extension (which already maintains a disk cache for its own purposes) registers a translator with Ruff:
const ruff = vscode.extensions.getExtension('charliermarsh.ruff');
await ruff.activate();
ruff.exports.registerUriTranslator({
translateToDisk(uri) { /* virtual URI → cached file:// URI */ },
translateToVirtual(uri) { /* file:// URI → virtual URI */ },
clearTranslationCache() { /* invalidate */ }
});
On registration, Ruff restarts its language server with LSP middleware that calls the translator.
Key point addressing the copy-all-files concern: Ruff does NOT need to copy any files itself. The VFS provider already maintains a persistent disk cache (for Pylance integration, editor operations, etc.). Ruff simply plugs into that existing cache via the translator interface. The caching is lazy — only files that are actually opened/referenced get cached by the VFS provider.
Changes needed in ruff-vscode
package.json — set virtualWorkspaces.supported: true
- New
src/common/uriTranslator.ts — interface definitions + registerUriTranslator export
src/extension.ts — activate() returns the API; on registration triggers server restart
src/common/server.ts — configure LSP middleware when translator is registered
src/common/settings.ts / utilities.ts — handle non-file:// URI schemes
Zero changes needed in the Ruff binary — the native ruff server already speaks LSP and doesn't care about URI schemes.
Context
I work on the Microsoft Fabric Data Engineering VS Code extension which uses a custom VFS. We already register a URI translator with Pylance for Python IntelliSense. Adding the same integration for Ruff would give our users linting/formatting in virtual workspaces.
Environment
- Extension version: 2026.40.0
- Ruff version: Any (native server)
Summary
I'd like to propose adding virtual workspace support to ruff-vscode by exporting a
registerUriTranslatorAPI — the same pattern Pylance already uses.Problem
The extension currently declares
virtualWorkspaces.supported: false. This blocks Ruff from providing linting/formatting in virtual workspace environments (GitHub Repositories, Microsoft Fabric notebooks, customFileSystemProviderworkspaces).No Python linter or formatter currently supports virtual workspaces (see microsoft/vscode-python#21459).
Proposed approach
Ruff exports
registerUriTranslator(), the VFS provider owns the cache.This is the exact pattern Pylance uses. The VFS provider extension (which already maintains a disk cache for its own purposes) registers a translator with Ruff:
On registration, Ruff restarts its language server with LSP middleware that calls the translator.
Key point addressing the copy-all-files concern: Ruff does NOT need to copy any files itself. The VFS provider already maintains a persistent disk cache (for Pylance integration, editor operations, etc.). Ruff simply plugs into that existing cache via the translator interface. The caching is lazy — only files that are actually opened/referenced get cached by the VFS provider.
Changes needed in ruff-vscode
package.json— setvirtualWorkspaces.supported: truesrc/common/uriTranslator.ts— interface definitions +registerUriTranslatorexportsrc/extension.ts—activate()returns the API; on registration triggers server restartsrc/common/server.ts— configure LSP middleware when translator is registeredsrc/common/settings.ts/utilities.ts— handle non-file://URI schemesZero changes needed in the Ruff binary — the native
ruff serveralready speaks LSP and doesn't care about URI schemes.Context
I work on the Microsoft Fabric Data Engineering VS Code extension which uses a custom VFS. We already register a URI translator with Pylance for Python IntelliSense. Adding the same integration for Ruff would give our users linting/formatting in virtual workspaces.
Environment