Force highlighting of possible context actions
Hi,
I would like to know if there's any possibility to force highlighting of r#'s context actions? I know I can configure which context actions should r# suggest, but that's not always enough.
Consider such use cases:
1.
public void Test(object element)
{
if (element is TextBox)
{
var tb = (TextBox)element;
// do sth
}
}
2.
public Control Test2(object element)
{
if (element is TextBox)
{
return (Control)element;
}
return null;
}
Now if I set the Inspection Severity of the rule "Type check and direct cast can be replaced with try cast and check for null" rule to Warning / Error ... resharper will highlight the 'if' and suggest in the first method.
I want the same to happen in the second method. Basically I want to force highlighting for certain context actions possibilities.
Possible in any way?
Please sign in to leave a comment.
Hello
I'm afraid it is not possible to force all context actions/quick-fixes in this case. Thank you!
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"