Guys,
I'm not sure if it's today's internal build or not but I have this weird behavior now. I have an option about putting single line statements on a new line switched off so I can type properties like this:
public int MyProperty
{
get { return _myProperty; }
set { _myProperty = value; }
}
In fact, if you don't switch it off JustCode will force the body of getters and setters to be moved on a new line. This _also_ isn't very nice as I would like to define this when I type the code, sometimes I want it to be on a new line, sometimes not. There is no true or false. But I'll get back to this later.
What I've noticed on the latest internal build (I can't compare to the old behavior, though) is when I type this:
public int MyProperty
{
get
{ | }
}
as soon as I hit enter it would turn into this:
public int MyProperty
{
get { }
}
|
Please note the cursor position! It's left outside of the block.
I have a feeling it wasn't like this on previous builds but anyway, you don't know what I'm going to type now. It may be a single line statement, it may well be a bunch of statements. You just don't have enough information to judge at that point so why do you force this single line rule?
In my opinion this formatting stuff should be adaptive, that is there is no black and white, true or false. There should be a reasonble breathing room. I'm fine with default VS formatting, it's not obtrusive and I would like JustCode to remain unobtrusive as well. You could also provide an option to disable JustCode formatting. Importing VS settings is not enough as JustCode seems to do a lot of extra formatting anyway.
To give you another example, say you want to type a lambda as a paramter to a method:
Calculate(
obj =>
{|})
// suppose my method parameter looks somthing like this:
private void Calculate(Action<
MyBusObject
> callback)
{
// do something here
callback(new MyBusObject());
}
As I know I'm going to put some several statements in my callback I move stuff to new line as I type (| indicates current cursor position) and when I hit enter I'm faced with this:
Calculate(
obj =>
{
}|)
I almost got used to it by now and it helps with that 'smart semicolon' feature because when the cursor is at that position pressing ; does the right thing.
However, my 'gut' expectation would be:
Calculate(
obj =>
{
|
})
So I can comfortably continue typing... But again, we lose the 'smart semicolon' here... It's never black and white ;)
However that issue with property declaration does need an attention. It just too roughly inforces formatting rules on me while I'm typing and I have more information about what it's going to be than the tool does. It just shouldn't get in the way. Just like VS never does...
My JustCode settings are close to defaults regarding code style, I wanted to attach my settings file but it looks like only images are allowed as attachments. I can send it to you, no problem.