sk> I don't like the null reference analysis and this is the first thing sk> I have ever turned off in R# since the 1.0 EAP! The thing with this sk> is that I write routines that expect the client to supply good sk> params. If it fails then good - fail and fail early! I found the sk> null reference analysis was inviting me to change code to be 'safer' sk> where I want the code to throw as soon as it's not happy.
Could you please give an example in which false NRE (Null Reference Exception) warning is issued? If parameters are not annotated with attributes specified in Code Inspection options, it should not show any warning. However, if you check it for null and then use parameter in other branch it will consider that param CAN be null and warn you. E.g.
private void foo(object p) { p.ToString(); // no warning }
private void foo2( object p) { if (p == null) // "Expression is always false" warning { } p.ToString(); // no warning }
sk> sk> Commenting....I'm not sure about whether it's R# or the Help Studio sk> Lite sk> install from the SDK, but I'm getting lots and lots of warnings sk> about XML sk> comments that were not there before and I can't find a way to change sk> them.
Could you please provide an example code?
sk> I love the ability to use ctrl+F12 in a file from a different sk> project...well cool again. How about allowing the File Structure sk> Window to display it also?
What do you mean by "file in a different project"?
sk> Resharper | View | File Structure Popup still shows the old sk> window.....should this not do the same as ctrl+F12?
"Go to file member" (new Ctrl-F12) is in the ReSharper | Go To menu. Old functionality is left there in case anyone want to use it. It will be decided during EAP whether we drop old one or not.
The latest EAP, 300, looks great. I've been working with it all day today.
The visuals are much improved and do fit better into VS2005 - the find results is much cleaner, the popup windows are smoother. I love 'Navigate from Here' - that's well cool!
The Go to File Member now using the same casing as ctrl+n is really good too. I wasn't sure about the way ctrl+arrow moves between caml-casings in symbols at first, but think this will be something I like....need to use it for a bit longer as I still expect to jump the whole symbol.
I don't like the null reference analysis and this is the first thing I have ever turned off in R# since the 1.0 EAP! The thing with this is that I write routines that expect the client to supply good params. If it fails then good - fail and fail early! I found the null reference analysis was inviting me to change code to be 'safer' where I want the code to throw as soon as it's not happy.
Commenting....I'm not sure about whether it's R# or the Help Studio Lite install from the SDK, but I'm getting lots and lots of warnings about XML comments that were not there before and I can't find a way to change them. It's clear that R# is doing some of this as there are new quickfixes for XML documentation, but I cannot find anything in R# options to change the behaviour (yet). (BTW going Resharper | Options & Highlighting and turning off "declaration is not documented" doesn't seem to do it for me!)
I love the ability to use ctrl+F12 in a file from a different project...well cool again. How about allowing the File Structure Window to display it also?
After install I had problems with R# reinitialising its main menu, but that was fine after it had done that once. I am getting more exceptions than I did with 265.......although I guess they are to be expected as we're back in to a 'real EAP' as opposed to stability improvements!
Resharper | View | File Structure Popup still shows the old window.....should this not do the same as ctrl+F12?
Last Edit Location (from ctrl+bkspace) and ctrl + - seem to be loosing the way a little......or maybe I'm coding too much! To early to say again here.
New From Template has lost my earlier additions...I just get "More...." and then the Choose Template dialog which won't allow me to select the add to quicklist checkbox (always greyed despite the selection).
The template in the quick-list is still there - missed it before! That's the only one in my user templates, so I guess the greyed-out behaviour is correct behaviour.
Resharper | Options & then Code Inspector .... can you tell me what that's about, please? Looks interesting ;)
Overall.....superb and I'm really looking forward to more 2.5 EAP releases. Keep up the excellent work Jetbrains! Cheers
Sean
>> Hey people, >> >> We opened ReSharper 2.5 EAP a couple of days ago and there is no >> posts in this forum with the feedback yet. We would appreciate your >> comments, thoughts, etc >> >> Valentin Kipiatkov >> CTO and Chief Scientist >> JetBrains, Inc >> http://www.jetbrains.com >> "Develop with pleasure!"
Responses to your last post inline below. I've jotted down a few other things I've found along the way too:
The following code gives the incorrect warnings shown in the comments.
public int Compare(object x, object y) { IComparable _x = x as IComparable; IComparable _y = y as IComparable;
if (_direction == SortOrder.Ascending) { if (_x == null && _y == null) { return 0; } // _y != null below underlined in blue // - expression is always true. else if (_x == null && _y != null) { return -1; } // _x != null below underlined in blue // - expression is always true. else if (_y == null && _x != null) { return 1; } }
Bad generics warning - see comments in the code below:
public static TOutput[] ToArray( delegate(TInput input) { TOutput output = input as TOutput; if (output == null && input != null) { throw new ArgumentException( string.Format("Unable to convert {0} to ", typeof (TInput), typeof (TOutput)), "input"); } return output; }); List();
// root is T below higllighted - the given expression is never of the provided type // and it offers to replace with false. if (!(root is T)) {
Similar to the above, but from this time going from an interface to normal type:
public static void SetParent(ICompositeTree item, ICompositeTree newParent) { if (item == null &&
Cheers
Sean
Hello sean,
Thank you for your feedback!
A pleasure to be able to help R# along ;)
sk>> I don't like the null reference analysis and this is the first sk>> thing I have ever turned off in R# since the 1.0 EAP! The thing sk>> with this is that I write routines that expect the client to supply sk>> good params. If it fails then good - fail and fail early! I found sk>> the null reference analysis was inviting me to change code to be sk>> 'safer' where I want the code to throw as soon as it's not happy. sk>>
Could you please give an example in which false NRE (Null Reference Exception) warning is issued? If parameters are not annotated with attributes specified in Code Inspection options, it should not show any warning. However, if you check it for null and then use parameter in other branch it will consider that param CAN be null and warn you. E.g.
private void foo(object p) { p.ToString(); // no warning } private void foo1(object p) { if (p == null) { } p.ToString(); // warning } private void foo2( object p) { if (p == null) // "Expression is always false" warning { } p.ToString(); // no warning }
Thanks for that. That now makes sense. I will turn NRE back on and configure my attributes!
sk>> Commenting....I'm not sure about whether it's R# or the Help Studio sk>> Lite sk>> install from the SDK, but I'm getting lots and lots of warnings sk>> about XML sk>> comments that were not there before and I can't find a way to sk>> change sk>> them.
Could you please provide an example code?
Sure...this is one which gives an error // HeaderDialog underlined in green - Missing XML comment for publicly visible type or member 'Ccc.Win etc...' public partial class HeaderDialog : BusinessObjectDialog {
sk>> I love the ability to use ctrl+F12 in a file from a different sk>> project...well cool again. How about allowing the File Structure sk>> Window to display it also? sk>>
What do you mean by "file in a different project"?
Sorry - I meant a file from a project that is not part of the current solution.
sk>> Resharper | View | File Structure Popup still shows the old sk>> window.....should this not do the same as ctrl+F12? sk>>
"Go to file member" (new Ctrl-F12) is in the ReSharper | Go To menu. Old functionality is left there in case anyone want to use it. It will be decided during EAP whether we drop old one or not.
Could you please give an example in which false NRE (Null Reference Exception) warning is issued? (...)
Here's an example that gives an unexpected NRE warning and missing "expression is always false|true" warnings:
object obj = null; string s = (obj ?? "").ToString(); // Expected "Expression is always
true", but get an NRE warning
Console.WriteLine(s);
object obj = 1;
string s = (obj ?? "").ToString(); // Expected "Expression is always
false", but get no warnings here
Console.WriteLine(s);
Console.WriteLine(obj ?? "]]>"); // OK - get "Expression is always false" here as expected
I'm also getting a lot of "Module xx should be referenced" errors in some solutions, so I've switched off highlighting while waiting for the next build (I believe this has been reported by other people already?)
Hello sean,
Thank you for your feedback!
sk> I don't like the null reference analysis and this is the first thing
sk> I have ever turned off in R# since the 1.0 EAP! The thing with this
sk> is that I write routines that expect the client to supply good
sk> params. If it fails then good - fail and fail early! I found the
sk> null reference analysis was inviting me to change code to be 'safer'
sk> where I want the code to throw as soon as it's not happy.
Could you please give an example in which false NRE (Null Reference Exception)
warning is issued? If parameters are not annotated with attributes specified
in Code Inspection options, it should not show any warning. However, if you
check it for null and then use parameter in other branch it will consider
that param CAN be null and warn you. E.g.
private void foo(object p)
{
p.ToString(); // no warning
}
private void foo1(object p)
{
if (p == null)
{
}
p.ToString(); // warning
}
private void foo2( object p)
{
if (p == null) // "Expression is always false" warning
{
}
p.ToString(); // no warning
}
sk>
sk> Commenting....I'm not sure about whether it's R# or the Help Studio
sk> Lite
sk> install from the SDK, but I'm getting lots and lots of warnings
sk> about XML
sk> comments that were not there before and I can't find a way to change
sk> them.
Could you please provide an example code?
sk> I love the ability to use ctrl+F12 in a file from a different
sk> project...well cool again. How about allowing the File Structure
sk> Window to display it also?
What do you mean by "file in a different project"?
sk> Resharper | View | File Structure Popup still shows the old
sk> window.....should this not do the same as ctrl+F12?
"Go to file member" (new Ctrl-F12) is in the ReSharper | Go To menu. Old
functionality is left there in case anyone want to use it. It will be decided
during EAP whether we drop old one or not.
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Mistake...see below
The template in the quick-list is still there - missed it before! That's
the only one in my user templates, so I guess the greyed-out behaviour is
correct behaviour.
>> Hey people,
>>
>> We opened ReSharper 2.5 EAP a couple of days ago and there is no
>> posts in this forum with the feedback yet. We would appreciate your
>> comments, thoughts, etc
>>
>> Valentin Kipiatkov
>> CTO and Chief Scientist
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
Hi Ilya
![]()
Responses to your last post inline below. I've jotted down a few other
things I've found along the way too:
The following code gives the incorrect warnings shown in the comments.
public int Compare(object x, object y)
{
IComparable _x = x as IComparable;
IComparable _y = y as IComparable;
if (_direction == SortOrder.Ascending)
{
if (_x == null && _y == null)
{
return 0;
}
// _y != null below underlined in blue
// - expression is always true.
else if (_x == null && _y != null)
{
return -1;
}
// _x != null below underlined in blue
// - expression is always true.
else if (_y == null && _x != null)
{
return 1;
}
}
Bad generics warning - see comments in the code below:
public static TOutput[] ToArray(
delegate(TInput input)
{
TOutput output = input as TOutput;
if (output == null && input != null)
{
throw new ArgumentException(
string.Format("Unable to convert {0} to ",
typeof (TInput), typeof (TOutput)), "input");
}
return output;
});
List();
// root is T below higllighted - the given expression is never
of the provided type
// and it offers to replace with false.
if (!(root is T))
{
Similar to the above, but from this time going from an interface to normal
type:
public static void SetParent(ICompositeTree item, ICompositeTree
newParent)
{
if (item == null &&
Cheers
Sean
A pleasure to be able to help R# along ;)
sk>> I don't like the null reference analysis and this is the first
sk>> thing I have ever turned off in R# since the 1.0 EAP! The thing
sk>> with this is that I write routines that expect the client to supply
sk>> good params. If it fails then good - fail and fail early! I found
sk>> the null reference analysis was inviting me to change code to be
sk>> 'safer' where I want the code to throw as soon as it's not happy.
sk>>
Thanks for that. That now makes sense. I will turn NRE back on and configure
my attributes!
sk>> Commenting....I'm not sure about whether it's R# or the Help Studio
sk>> Lite
sk>> install from the SDK, but I'm getting lots and lots of warnings
sk>> about XML
sk>> comments that were not there before and I can't find a way to
sk>> change
sk>> them.
Sure...this is one which gives an error
// HeaderDialog underlined in green - Missing XML comment for publicly
visible type or member 'Ccc.Win etc...'
public partial class HeaderDialog : BusinessObjectDialog
{
sk>> I love the ability to use ctrl+F12 in a file from a different
sk>> project...well cool again. How about allowing the File Structure
sk>> Window to display it also?
sk>>
Sorry - I meant a file from a project that is not part of the current solution.
sk>> Resharper | View | File Structure Popup still shows the old
sk>> window.....should this not do the same as ctrl+F12?
sk>>
Okay thanks.
Here's an example that gives an unexpected NRE warning and missing
"expression is always false|true" warnings:
object obj = null;
string s = (obj ?? "").ToString(); // Expected "Expression is always true", but get an NRE warning Console.WriteLine(s); object obj = 1; string s = (obj ?? "").ToString(); // Expected "Expression is always false", but get no warnings here Console.WriteLine(s); Console.WriteLine(obj ?? "]]>"); // OK - get "Expression is always
false" here as expected
I'm also getting a lot of "Module xx should be referenced" errors in some
solutions, so I've switched off highlighting while waiting for the next
build (I believe this has been reported by other people already?)
Best wishes,
Dag Christensen
Hello,
We appreciate your feedback.
The corresponding JIRA request has been created, and you are welcome to monitor
its status at http://www.jetbrains.net/jira/browse/RSRP-31426.
Best regards,
- Development Team.