GROOVY-3328: Automatic imports for selected text execution

Created pull request to of suggested solution by Jose Osinde and test by Sergey Bondarenko