Skip to content

Conversation

@sxyazi
Copy link
Owner

@sxyazi sxyazi commented Dec 5, 2025

Follow-up to #3396

This PR corrects terminology in the virtual filesystem before the official release by introducing a new "service" concept to distinguish it from the existing "provider":

  • Provider: the backend implementation of the VFS, e.g. SFTP
  • Service: a concrete instance of a provider, i.e. a specific provider setting, for SFTP this is the set of parameters like host, port, user, etc.

If you used the providers field in vfs.toml, please replace it with services. For example:

- [providers.my-server]
+ [services.my-server]
type = "sftp"
host = "1.2.3.4"
user = "root"
port = 22

The latest nightly documentation has been updated to reflect this change: https://yazi-rs.github.io/docs/next/configuration/vfs

sxyazi added a commit to yazi-rs/yazi-rs.github.io that referenced this pull request Dec 5, 2025
@sxyazi sxyazi requested a review from Copilot December 5, 2025 06:22
Copilot finished reviewing on behalf of sxyazi December 5, 2025 06:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR performs a comprehensive refactoring of the VFS system, introducing clearer terminology by distinguishing between "provider" (the backend implementation) and "service" (a concrete instance with specific settings). Beyond the terminology change, it also refactors symlink operations and path handling utilities.

  • Renamed Provider enum to Service and ProviderSftp struct to ServiceSftp throughout the codebase
  • Changed the VFS configuration field from providers to services in vfs.toml
  • Refactored symlink function signatures to use a more intuitive parameter order (link first, then original/target)
  • Converted URL-based relative path calculation to path-based calculation for improved clarity

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yazi-config/src/vfs/mod.rs Updated module declaration to import service instead of provider
yazi-config/src/vfs/service.rs Renamed Provider enum to Service and ProviderSftp to ServiceSftp
yazi-config/src/vfs/vfs.rs Renamed providers field to services and updated method names and error messages
yazi-vfs/src/provider/sftp/conn.rs Updated type references from ProviderSftp to ServiceSftp
yazi-vfs/src/provider/sftp/gate.rs Updated type and method references to use ServiceSftp and Vfs::service()
yazi-vfs/src/provider/sftp/mod.rs Updated static hashmap type to use ServiceSftp
yazi-vfs/src/provider/sftp/sftp.rs Updated struct field and method call to use ServiceSftp and Vfs::service()
yazi-vfs/src/provider/provider.rs Reordered symlink function parameters to place link before original for better API ergonomics
yazi-scheduler/src/file/file.rs Updated symlink call to match new parameter order and refactored relative path handling to use path-based calculation
yazi-shared/src/path/cow.rs Added PartialEq implementation for PathCow to enable equality comparisons
yazi-fs/src/path/relative.rs Refactored from URL-based to path-based relative calculation with comprehensive test coverage
yazi-fs/src/path/path.rs Removed obsolete URL-based relative path tests
yazi-plugin/preset/plugins/mime-remote.lua Added check to skip dummy files in MIME detection
yazi-plugin/preset/plugins/fzf.lua Added virtual filesystem detection to prevent fzf usage in unsupported contexts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

sxyazi added a commit to yazi-rs/yazi-rs.github.io that referenced this pull request Dec 5, 2025
@sxyazi sxyazi merged commit 0c6b022 into main Dec 5, 2025
16 checks passed
@sxyazi sxyazi deleted the pr-9babb871 branch December 5, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants