private void insertContent(final XtextEditor editor, final StyledTextAccess styledTextAccess) {
final AtomicBoolean shouldInsertSemicolon = new AtomicBoolean(true);
final IXtextDocument document = editor.getDocument();
final List<Pair<EObject, Long>> commentsToUpdate = Lists.newLinkedList();
document.readOnly(NULL_UNIT_OF_WORK); // wait for reconciler to finish its work.
try {
/*
* Textual and semantic updates cannot be done in the same IUnitOfWork (throws an
* IllegalStateException), so index updates (semantic) are done first and tracked in the
* commentsToUpdate list, then a 2nd IUnitOfWork processes the comment updates (textual).