New to resharper Follow
I have an employee who is just starting to use resharper and has been getting the following warning "Split declaration and assignment." Her question is why is she getting this warning is there a document or web site that we could look at to explain what the warnings mean and if we should disable the warning or modify our code.
Please sign in to leave a comment.
That's not a warning at all but rather a "Context Action". It is a quick way to to turn:
string foo = "bar";
into:
string foo;
foo = "bar";
You don;t need to do that unless you need to as part of some larger code change.
Notice there is no orange bar in the right margin which would indicate a wanring. Also, the light bulb that pops up is red for a warning but "not red" for a context action.
Hope this helps.
jlo
unless there is a green check the code cannot be checked in per SOP
I just dont get why it has even say split declaration and assignment
for example there is nothing wrong with this in any way shape of form
but resharper says split it
Dim strNumber As String = "0"
to
Dim strNumber As String
strNumber = "0"
so what can go wrong with leaving it alone?
NOTHING
so why is it saying fix it?
Did you even read Jeffrey's answer?
It's not a warning; it's not telling you to "fix" it; it's just offering you the option to refactor your code.
If you use the context action to split the declaration and assignment, you'll then be offered a context action to join them again.
I think you missed my point
The green checkbox is not there and per SOP it cannot be checked in
What "green checkbox"? That doesn't sound like a R# feature.
DOH
configuring the inspecion severity is not an option
Attachment(s):
resharper.PNG
Becase this is NOT an inspection!
The option you are describing is a context action. It is an option to refactor your code. It is NOT a warning or an error. It will NOT appear in the R# marker bar.
If your marker bar is showing errors or warnings, there is something else wrong with your code. It is NOTHING to do with the "split declaration and assignment" context action!
that was th eonly mark on the page
Thanks for yelling
Have a nice day/life
goodbye
reported for abuse
goodbye
just an FYI
we just purchased resharper for the company
Many of the developers never used it, some never heard about it
However if this is they way we are treated when we have a question perhaps we should rethink it
Go have a pint it might help your terrible attitude
Goodbye no need to reply again
Gents, I think it's time to call this conversation done. JetBrains staff (such as myself) do monitor the forums, and this conversation has reached the point where it's not going to help anyone else. Let's just leave it at this, and move on.
Thanks
Matt
thank you
Great avatar I have original lego space men at home from 40 yrs ago