Hi,
I don't known if you guys already has something like this planned:
I would like to have the intention feature expanded to help me handle exception code faster. I really like the "Surround with..." feature but when I update my code and some new exceptions should be handled it doesn't help me much.
So consider the example below:
void someMethod throws Exception1 {
try {
//some code throwing Exception1-3
//some new code throwing Exception4
} catch(Exception2 e) {
...
} catch(Exception3 e} {
...
}
}
IDEA would detect that Exception4 is not handled and show the light bulb with options to add it to the try-catch clause or add it to the methods throws section.
Other suggestions inline with the new if split intention:
If cursor is placed on a catch keyword the light bulb could suggest to add this Exception to the throws section (if the catch did not have any handling code) or maybe add it to a surrounding try-catch clause. I would find that useful when I use "Surround with..." and it finds a bunch of exceptions but some of them I would rather pass on to the throws section.
If cursor is placed on the throws keyword it could suggest to update the throws section.
Well what do you think?
Michael
