- Home /
Unity3d/Monodevelop formatting and tab settings
Since some version of Unity (5.3.2?) the formatting/indenting behaviour of Monodevelop is, and I'm sorry to say this, absolutely crazy. And I say that relative to my normal development expectations of using monodevelop.
Opening up any of my source files randomly tabs or indents (actually, it doesn't seem to tab or indent entirely at random - it indents at 8 and tabs at 4.) Additionally, braces are forced to be on the line above, and you can't just do what you used to do, which was let Monodevelop do whatever auto-formatting it does, then hit cmd-z to undo it, as doing so also undoes any code you typed.
Additionally, formatting behaves semi-randomly, until I allow monodevelop to auto-format the entire source file. Then it does seem to match the file.
Seriously:
Is there a clean way to set Monodevelop to some sensible settings, that persist across all of my Unity projects and installs (I have many side-by-side installs of unity and across different machines (mac/windows.) Where are monodevelop preferences persisted and how do I make them sane (braces on sepearate lines, etc), and persist them across all projects.
Am I the only one who thinks that discussion about e.g. Using REST to communicate between Monodevelop and unity isn't grounded in reality, as as far as I can see, Monodevelop barely works. Is it only me seeing this (across many projects?)
I have uploaded screenshots of my monodevelop settings and what it thinks a C# file should look like (sane.) If I'm able to I'll include a video screen recording of the behaviour with those settings showing the issue.
Here's a screenshot of what Monodevelop thinks my settings are (which bears no resemblance to what it's doing when auto-formatting), and also a dropbox link to a movie screen capture of attempting to use the editor.
Your dropbox video isn't up anymore. You should upload that movie to youtube, so it can be up permanently.
Answer by ferretnt · May 10, 2016 at 10:17 PM
Clearly it's just me and monodevelop works flawlessly.
It's not just you. Your "sane" looks of C# is a code perfection. Which held me from using C#, that stupid default auto-formatting. What you shows is what I'd love to learn from you. If you could, I'd make use of all settings' screens that lets you format the way on your last screen here. (it's actually UnityScript default formatting for $$anonymous$$onoDevelop)