Jiří Travěnec
Jiří Travěnec

Reputation: 107

Visual Studio 2010 Exceptions checking extension

I'm looking for some way to make a VS editor highlight methods that throws an exception. I've looked around for some add-in, but I haven't found any suitable.

So I've been looking for some tutorials describing how to make my own add-in. I found many tutorials showing how to underline text, modify tooltip and so on, but I haven't found any tutorial that shows how to access a documentation of specific method.

I'll be glad for any help.

Upvotes: 0

Views: 266

Answers (3)

Val Bakhtin
Val Bakhtin

Reputation: 1464

You also can set Exception settings of VS (Ctrl-Shift-E) to stop immediately on exception thrown. That will cease execution on method that caused exception and put cursor on it.

Upvotes: 0

Minus
Minus

Reputation: 729

You can use the VS debugger to follow the code or use breakpoints to run a macro that will highlight lines (not sure this will york properly because you have to apply them at some crucial points)

Upvotes: 0

Sergey Berezovskiy
Sergey Berezovskiy

Reputation: 236188

You can use information provided by IntelliSense:

enter image description here

You can provide exception list to IntelliSence via xml comments to your methods:

/// <summary>
/// Foos every bar.
/// </summary>
/// <exception cref="System.ArgumentOutOfRangeException"/>
public static void Foo()
{
    throw new ArgumentOutOfRangeException();
}

Upvotes: 2

Related Questions