Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
The "Remove trailing whitespace" option in the source code formatting dialog does not work for C#.
I expect any trailing whitespace to be removed from lines when I save the file.
Please let me know if you need any more details.
We should change the options name - it only removes lines that are only whitespace.
We had problems destroying c# specfic @" .... " contents - we should rename it to "virtual mode" or something.
For me that option does nothing at all. It neither removes lines completely made of whitespaces nor trailing whitespaces of lines with text.
I think it's a misunderstanding what this does - it's named poorly :/
That creates in the next line:
If you now press cursor up the ->-> are gone - they're just 'virtual' (they don't get saved)
Ah, I understand. I assume that behavior changed from earlier versions?
I can't get it to work at all. Whitespace for blank lines are saved too. For example, following Mike's notation, if I write:
The following is saved to file, spaces and all:
This is in version 4.0.3 (build 13, OS X). Remove trailing whitespace is enabled for C# and text files in Preferences, Solution Options and Project Options.
Works for me - does this persist even after restart -
it is our default setting btw.
Yes, it persists after restart.
Just tried opening xamarin studio, then, with no open project do, File -> New... -> File -> C# -> General -> Empty Class.
I also tried the same with creating a new project.
In both cases, I kept the default settings, which included Remove Trailing Whitespace being on in Preferences and (if available) in project settings.
Empty lines were still saved with whitespace included.
Can't think of any reason why it shouldn't work here :\ Just to be sure, we agree the expected behavior is that a line that contain only whitespace should be saved as a line containing nothing but a newline character, right?
It has nothing to do with the save command
It's on caret up/down, movement etc. lines with indenting white spaces only should not exist there.
Ok, I think I'm not understanding what this is supposed to do.
From comment #3, this certainly does not work:
> If you now press cursor up the ->-> are gone - they're just 'virtual' (they
don't get saved)
But being as unsure of this feature as I am, I can't claim with certainty that there is a bug.
I'll find a different way to remove trailing whitespace. (Outside of Xamarin Studio)
What the hell? RESOLVED FEATURE? Seriously?