boolean (InsertionContext context, int offset) { if (offset < 0) { return false; } OffsetKey key = context.trackOffset(offset, false); PostprocessReformattingAspect.getInstance(context.getProject()).doPostponedFormatting(); offset = context.getOffset(key); if (offset < 0) { return false; } String open = escapeXmlIfNeeded(context, "<"); context.getDocument().insertString(offset, open); offset += open.length(); context.getEditor().getCaretModel().moveToOffset(offset); if (CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET) { context.getDocument().insertString(offset, escapeXmlIfNeeded(context, ">")); context.commitDocument(); TabOutScopesTracker.getInstance().registerEmptyScope(context.getEditor(), offset, getTabOutOffset(context, offset)); } if (context.getCompletionChar() != Lookup.COMPLETE_STATEMENT_SELECT_CHAR) { context.setAddCompletionChar(false); } return true; }