Force highlighting of possible context actions


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:


        public void Test(object element)
            if (element is TextBox)
                var tb = (TextBox)element;
                // do sth


        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?
1 comment
Comment actions Permalink

     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

"Develop with pleasure!"


Please sign in to leave a comment.