eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
37 stars 91 forks source link

View for tracing exception propogation routes #583

Open trancexpress opened 1 year ago

trancexpress commented 1 year ago

See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=123948

it would be very neat to be able to select exceptions declared thrown in a methods signature, or particular exceptions thrown in the method body, and have eclipse generate an upward tree of where these exceptions go.

The difference between this and call-hierarchy is that three different behaviours could be added in this context i) when an exception is caught then the exception can't propogate upward further so this branch would end in the call-hierarchy view. (If some logic possibly rethrows the exception or wraps it, then i think its reasonable to have the user perform a second search to pursue its route further) ii) when an exception is never caught, then the branch collapsed by default and marked visually as being a path that is uncaught iii) as the intent of the user when asking for this is focussed on finding the places where the exception is not propogated any further (i.e. it is caught or interrupts its host thread) then automatically going as far as is reasonable in the search makes sense. In theory this could be prohibitively expensive but in my experience is most often not - maybe a preference could allow a maximum number of nodes in the call-tree before no further automatic pursuing of propogation paths is allowed.

stephan-herrmann commented 1 year ago

Shouldn't we move this (nice!) request to jdt.ui?