* @return the text regions corresponding to <code>selection</code>
* @throws BadLocationException if accessing the document failed
* @since 3.5
*/
public static IRegion[] getCoveredRanges(ITextViewer viewer, ITextSelection selection) throws BadLocationException {
return new SelectionProcessor(viewer).getRanges(selection);
}