{
final Point selection= rememberSelection();
final IRewriteTarget target= getRewriteTarget();
final IDocument document= getDocument();
IFormattingContext context= null;
DocumentRewriteSession rewriteSession= null;
if (document instanceof IDocumentExtension4) {
IDocumentExtension4 extension= (IDocumentExtension4) document;
DocumentRewriteSessionType type= (selection.y == 0 && document.getLength() > 1000) || selection.y > 1000
? DocumentRewriteSessionType.SEQUENTIAL