[MonoDevelop] Formatting text: change pasted / open document formatting?

IBBoard ibboard at gmail.com
Sun Dec 19 08:57:46 EST 2010

On 18/12/10 21:19, Dotan Cohen wrote:
> Thanks for the quick reply.
> On Sat, Dec 18, 2010 at 22:57, IBBoard<ibboard at gmail.com>  wrote:
>> You can manually format,
> Too much code!

Sorry, I meant "manually tell MonoDevelop to format it". I've got 
Ctrl+Shift+F set up as a shortcut (I think), or there is a Format menu 
under Edit :)

>> and you can format on save (the latest Git version
>> has an option in Preferences under Behaviour),
> Great, that might be a workaround: open then immediately save.
>> but I think I had to argue
>> for the latter to be added. Some people thought that it was bad behaviour
>> because it meant that code changed in ways that they might not see (e.g.
>> closing with unsaved changes and hitting "save" when prompted), but I wanted
>> it for roughly the same reason as you.
> Code changing in unseen ways would be bad, I agree, but formatting and
> whitespace are for humans, not compilers. It is no more code than are
> comments. Debatable, I know (it would be annoying to recompile due to
> a "change" that is only whitespace) but that's my stand on it.

That depends on your formatting rules. You can force braces with the 
formatting policies, or forcefully remove them where they're not needed. 
That still shouldn't affect the structure of the code, but it is a 
little bit more than whitespace. I think it was partly a "I want it 
saved exactly how I wrote it" issue where the person didn't always 
follow their coding standards and wanted to keep some of their custom 

>> Different indentation preferences in terms of how many spaces a tab is
>> should be supported, but anything for the other formatting options needs an
>> action to make it happen.
> An action, such as?

I was thinking of saving, clicking the menu item, pressing the shortcut 
keys, or whatever other mechanisms anyone adds in future.

>> I'm not sure why you wouldn't be able to build C# in Kubuntu, though. As
>> long as you've got MD and all of the appropriate Mono dependencies then you
>> should be able to build in KDE. There's something really wrong if you can't,
>> what with MonoDevelop building code on Windows and Mac as well these days!
> C# in the mono implementation builds on Kubuntu, but not Visual C#. C#
> is the standard, the two big implementations of the standard are
> Visual C# and Mono. I am working with Visual C# code.

What is the difference? 99% of Visual C# code will work in Mono. I've 
got apps that I wrote in Visual Studio (I use a virtual machine for 
Windows) that compile fine in MonoDevelop and run on Mono. Most of my 
development is in MonoDevelop on Linux, but with Visual Studio for a 
WinForms front-end. I've even compiled some of my WinForms apps 
successfully in MonoDevelop.

More information about the Monodevelop-list mailing list