Bug 11431 - Autoformat should not alter my byte* declarations
Summary: Autoformat should not alter my byte* declarations
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 2.9.x
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2013-03-26 15:38 UTC by Miguel de Icaza [MSFT]
Modified: 2013-03-27 11:31 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description Miguel de Icaza [MSFT] 2013-03-26 15:38:12 UTC

byte *x = null;

When I type the ";"

It inserts a space between the "*" and "x".

This should not happen
Comment 1 Mike Krüger 2013-03-27 08:11:39 UTC
Was an issue in the formatting engine not visiting the composed types. I really need to rework the formatting code :/.

It now formats correctly as "byte* x;"
Comment 2 Miguel de Icaza [MSFT] 2013-03-27 10:51:50 UTC
Please, use C notation, not the C++ one:

"byte *x"
Comment 3 Mike Krüger 2013-03-27 11:15:07 UTC
We can make an option for it - I've never seen anyone doing the C notation in C#.

"byte *x" is very obscure in C#. See this example which type has y:

byte *x, y;

And what about "byte? x" are you typing "byte ?x"?

As said I can add an option for pointers. Should that be in the 'mono' style ?

btw. we should change the default formatting to something other than mono - I still think allman/vs.net is the way to go.
Comment 4 Miguel de Icaza [MSFT] 2013-03-27 11:24:02 UTC
Very good observation.

I understand the scenario for "byte *x, y"

How if I only have "byte *x", the IDE does not reformat my code?
Comment 5 Mike Krüger 2013-03-27 11:31:28 UTC
hm, that's easy:

Go to options -> text editor -> Behavior

And turn off on the fly code formatting.

But the goal should be to create t he best on the fly formatting engine possible, unfortunately that requires 100.000 +-5 options.