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.
Description of Problem:
Custom code formatting settings are ignored by Format command (either Format Selection or Format Document).
Steps to reproduce the problem:
1. Set solution code format option (for example no space between method and paren)
2. Set project code format option to inherited.
3. Format a document that is presently in conflict with the format setting.
No change to the document.
Code would be formatted according to the setting.
How often does this happen?
Should be fixed in master.
I rebuilt from:
Git revision: ddd37ced4f49d0c4aa635916c46fb94adff40fca
Build date: 2012-07-26 11:10:38+0000
And continue to see the issue. Perhaps there is a problem with new code versus existing code? Or very long lines? I created a new file, intentionally out of format, did a reformat and it fixed the formatting. However, I formatted an existing file which also has format violations (example, with space in outer method call):
resetmap.Add ("qtd", fullspec.EnumerateIndices(new TimeSpec(fullspec.Begin, fullspec.End, PeriodicityType.Quarter)).Select(i => i.I1).ToList());
and that was not corrected.
Then the formatting does work - but not all cases, is that right ?
(That's a different issue than custom code formatting does not work)
btw. I still can't reproduce it - that's what I did:
Can you make a screencast ?
I was unable to make a screencast. I tried two different packages and neither worked. I am surprised you cannot replicate this bug. I have two new ubuntu installations of monodevelop + our code base and both exhibit this. The code formatting ignores the settings, I've yet to see it do otherwise.
Can you give me a small project with the settings ?
I set out to make a small project and in that project it (code formatting) did work. However it still does not work in my large project. While I cannot make a screen cast, I can do screen shots. I am attaching a sequence of these.
Perhaps it is relevant that the large project is shared between multiple users some of whom use Visual Studio. However, as you can see in the screen shots, the settings are set to not put spaces in. Spaces is one example, all of the formatting options as near as I can tell are ignored.
Thank you for your help,
Created attachment 2731 [details]
First image in code formatting sequence
Here I have selected the text I want to format. Notice the space between DefaultCalcPeriod and (calc).
Created attachment 2732 [details]
Second image in code formatting sequence
Here are the settings for white space for the project the file is in. Notice spaces are off.
Created attachment 2733 [details]
Third image in code formatting sequence
These are the remaining code format options for whitespace for the project the file is in.
Created attachment 2734 [details]
Final image in code formatting sequence.
Here I select Format Selection. After this the code is unchanged. I expect it to remove the space between DefaultCalcPeriod and (stat).
Should be fixed (at least it works for me - we had a broken format selection at that time btw.)