Why doesn't "Place constructor initializer on same line" work?
Hello,
I have R# installed on VS2010 Pro, and have checked the box to say I want constructor intialiasers on the same line. According to the preview, this shoudl give the following...
class C {
public C() : base() {
}
}
However, R# insists on changing my code to...
class C {
public C()
: base() {
}
}
...which I find quite annoying.
Why doesn't this work? Is there anything I can do to force R# to leave my base() on the same line?
Thanks
Please sign in to leave a comment.
Hello,
What's the exact version of ReSharper that you're using? I couldn't reproduce
this behavior with the latest build of ReSharper 6. Thank you!
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Hello,
Sorry for the delay in replying, I didn't get a notification of your post.
Anyway, I'm using version 5.1.3, which is the latest production version on your download page.
Any comment?
What was the point of replying if you're going to ignore my answer?
This feature does not work correctly in R#5. Maybe it works in v6, but that doesn't help me, as v6 isn't available. I would like to know why it doesn't work in the current public version of R#, and how I get it working.
Not that anyone from JetBrains appears to be interested in this problem, but I upgraded to R# 6 the other day, and this problem is still there!
I have checked, and the "Place constructor initializer on same line" is checked, yet when I reformat my code, it puts the base() part on the next line. I can even move it back onto the previous line, hit Ctrl-K, D and end up with...
public Ferret() : base(view) {Anyone any idea why this is happening? Anyone except me care?
Hello Yossu,
Sorry for delayed response! I didn't notice your post for some reason. I'm
afraid I couldn't reproduce this behavior with ReSharper 5.1.3. Could you
please export your code style settings (through ReSharper | Options | Languages
| Common | Code Style Sharing) and attach them here along with a small sample
solution which would demonstrate that formatting? Thank you!
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Well, as I mentioned, I'm actually using version 6 now, and the problem is still there.
However, I had an e-mail from Alex Berezoutsky this morning, who asked me to send him a screencast of the problem. I've done that, so hopefully he will be able to look into it further.
Thanks
In case it helps anyone, it turned out that the reason was because I was still using Ctrl-K, Ctrl-D to reformat code, which is the standard VS shortcut. As a result, it was using VS's rules, not R#'s. If I use Ctrl-E, Ctrl-F then it works fine.