int (@NotNull InsertionContext context) { int start = context.getTailOffset() - 1; while (start >= 0) { char ch = context.getDocument().getCharsSequence().charAt(start); if (!Character.isJavaIdentifierPart(ch) && ch != '.') break; start--; } return start + 1; }