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 to exclude file types from Files: Trim Trailing Whitespace #180928

Closed
ermshiperete opened this issue Apr 26, 2023 · 4 comments
Closed

Allow to exclude file types from Files: Trim Trailing Whitespace #180928

ermshiperete opened this issue Apr 26, 2023 · 4 comments
Assignees
Labels
*out-of-scope Posted issue is not in scope of VS Code under-discussion Issue is under discussion for relevance, priority, approach

Comments

@ermshiperete
Copy link

I'd like to define exceptions for files.trimTrailingWhitespace so that it doesn't trim trailing whitespace for some file types.

My use case is that I have .patch files. These use trailing tabs and whitespace to detect filenames and end of patch. If I edit and save a .patch file patch is no longer able to apply the patch. I'd like to define an exception so that trimming trailing whitespace doesn't happen for files ending in .patch or of type diff.

@gjsjohnmurray
Copy link
Contributor

Can you handle it this way?

#120468 (comment)

@rzhao271 rzhao271 added the info-needed Issue requires more information from poster label Apr 26, 2023
@ermshiperete
Copy link
Author

ermshiperete commented Apr 27, 2023

Yes, thanks, adding these lines to settings.json work:

   "[diff]": {
     "files.trimTrailingWhitespace": false
    },

However, that is not at all intuitive in the visual settings editor:

  • it is not clear that by searching for "@lang:diff:" you'll see settings that apply only to that language. Searching for other things, even with the @... syntax, only filters what gets displayed, whereas with @lang:... you see a complete independent set of settings.
  • if you search for "@lang:diff trimTrailingWhitespace" (without having the setting in settings.json) it looks like the option is already off, even though it will be on because it's set in the global setting.

@rzhao271
Copy link
Contributor

rzhao271 commented May 1, 2023

The second issue is #58038
Feel free to recommend/suggest additional designs for the first issue.

@rzhao271 rzhao271 added under-discussion Issue is under discussion for relevance, priority, approach and removed info-needed Issue requires more information from poster labels May 1, 2023
@rzhao271 rzhao271 added the *out-of-scope Posted issue is not in scope of VS Code label Dec 7, 2023
@VSCodeTriageBot
Copy link
Collaborator

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2023
@aiday-mar aiday-mar added this to the December / January 2024 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*out-of-scope Posted issue is not in scope of VS Code under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

6 participants