public static boolean promptTypeArgs(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); context.getEditor().getCaretModel().moveToOffset(offset + open.length()); context.getDocument().insertString(offset + open.length(), escapeXmlIfNeeded(context, ">")); context.setAddCompletionChar(false); return true; }
private static void removeLookupString(InsertionContext context) { context.getDocument().deleteString(context.getStartOffset(), context.getTailOffset()); context.commitDocument(); }