Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Selective Auto-Delete for Remote Files on Local Deletion #1031

Open
miztizm opened this issue Jun 1, 2024 · 0 comments
Open

Comments

@miztizm
Copy link

miztizm commented Jun 1, 2024

Summary:
I am requesting an enhancement to the SFTP/FTP extension that would allow for the auto-deletion of a single remote file when its corresponding local file is deleted from Visual Studio Code. This feature should operate independently of full directory synchronization, functioning similarly to the "Upload on Save" feature but for deletions.

Current Behavior:
Currently, the extension supports syncing changes between local and remote directories, including deletions. However, this is part of a broader sync functionality that mirrors the entire directory structure.

Requested Behavior:
I would like the extension to support a more granular approach where individual file deletions in the VS Code editor can trigger the deletion of the corresponding file on the remote server without needing to sync the entire directory. This behavior should be similar to the "Upload on Save" feature, where saving a file locally automatically updates the file on the remote server.

Use Case:
This feature would be particularly useful for developers who work in environments where changes are frequently made and tested incrementally. Being able to delete a file locally and have that change immediately reflected on the server without manually syncing the entire directory would streamline workflows significantly.

Implementation Suggestion:
A possible implementation could involve adding a configuration option such as autoDeleteOnLocalDelete in the sftp.json configuration file. When set to true, this would enable the behavior. Here is a possible configuration snippet:

{
    "name": "Server",
    "host": "example.com",
    "protocol": "sftp",
    "port": 22,
    "username": "username",
    "password": "password",
    "remotePath": "/path/to/remote",
    "uploadOnSave": true,
    "autoDeleteOnLocalDelete": true
}

Additional Notes:

Ensuring that this feature includes safeguards or confirmations before deletion could help prevent accidental data loss.
Optionally, this feature could be extended to include other actions triggered by local events, enhancing the flexibility of the extension.
I believe this feature would enhance the utility of the SFTP/FTP extension by making it more adaptable to a variety of development workflows and environments.

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

No branches or pull requests

1 participant