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

Allow deleting files via the explorer when a folder is marked as readonly #195701

Closed
Tyriar opened this issue Oct 16, 2023 · 5 comments
Closed

Allow deleting files via the explorer when a folder is marked as readonly #195701

Tyriar opened this issue Oct 16, 2023 · 5 comments
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality file-explorer Explorer widget issues file-io File I/O insiders-released Patch has been released in VS Code Insiders papercut 🩸 A particularly annoying issue impacting someone on the team verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Oct 16, 2023

Scenario: I wanted to delete node_modules/xterm and replace it with a symlink to a locally cloned repo so I tried to delete it via the explorer. The action is completely blocked currently:

Image

This was due to discussion from a single user in #4873 (comment) where they say it's expected that it would block deleting the folder in the explorer as well. This goes too far imo, the purpose of the feature as I understand it is to prevent accidental edits to files.

If I as a user want to delete the file with the explorer, VS Code simply does not let me currently so I have to find another route, like via the terminal or Windows Explorer. It's just a pain and the IDE getting in the way imo, the chance that not blocking the operation would cause problems is so small as there's a confirmation before deleting it as well.

@bpasero bpasero added feature-request Request for new features or functionality file-explorer Explorer widget issues labels Oct 16, 2023
@bpasero bpasero added this to the Backlog milestone Oct 16, 2023
@bpasero bpasero removed their assignment Oct 16, 2023
@bpasero
Copy link
Member

bpasero commented Oct 16, 2023

fyi @lramos15

@acidoxee
Copy link

I'd like to second this. I have this setting to avoid modifying those files accidentally:

{
  "files.readonlyInclude": {
    "**/*.tsbuildinfo": true,
    "**/__generated__/**": true,
    "**/dist/**": true,
    "**/generated/**": true,
    "**/node_modules/**": true
  }
}

It's useful that vscode doesn't allow me to modify those files, because sometimes you'll explore those areas to see under the hood, but you wouldn't want to be able to comment or modify stuff, as you'd likely forget about it. Moreover, those folders often are ignored from git, so a manual modification in there could stay unnoticed for a while.

Although, most of those files aren't permanent. I do want to be able to delete them, as there always will be a way to generate them back (or generate a new version of them). If I keep the "files.readonlyInclude" setting as is, I'm unable to do so, and I must either rely on scripts to do it (like a custom npm run clean, but this usually doesn't leave much room for precision) or comment the "files.readonlyInclude" setting, delete what I want, and then un-comment the setting each time I need to do this.

It would be great to have another setting available that dictates whether "files.readonlyInclude" locks away or not the ability to delete those files.

@Tyriar
Copy link
Member Author

Tyriar commented Sep 17, 2024

Allowing this makes even more sense now that we allow editing the file with a warning:

Image

@bpasero bpasero self-assigned this Dec 4, 2024
@Tyriar Tyriar added the papercut 🩸 A particularly annoying issue impacting someone on the team label Dec 4, 2024
@bpasero bpasero modified the milestones: Backlog, January 2025 Dec 28, 2024
@bpasero bpasero added the verification-needed Verification of issue is requested label Jan 6, 2025
@bpasero bpasero closed this as completed in 85925ef Jan 6, 2025
@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Jan 6, 2025
@vs-code-engineering vs-code-engineering bot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jan 7, 2025
@bpasero bpasero added the author-verification-requested Issues potentially verifiable by issue author label Jan 8, 2025
Copy link

This bug has been fixed in the latest release of VS Code Insiders!

@Tyriar, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 9b0b13d of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@Tyriar Tyriar added the verified Verification succeeded label Jan 8, 2025
@Tyriar
Copy link
Member Author

Tyriar commented Jan 8, 2025

Thanks so much 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality file-explorer Explorer widget issues file-io File I/O insiders-released Patch has been released in VS Code Insiders papercut 🩸 A particularly annoying issue impacting someone on the team verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants