List<TextRange> (@NotNull PsiElement e, @NotNull CharSequence editorText, int cursorOffset, @NotNull Editor editor) { final TextRange originalRange = e.getTextRange(); LOG.assertTrue(originalRange.getEndOffset() <= editorText.length(), getClass() + "; " + e); List<TextRange> ranges; if (isSeparateStatement(e)) { ranges = ExtendWordSelectionHandlerBase.expandToWholeLine(editorText, originalRange, true); if (ranges.size() == 1 && ranges.contains(originalRange)) { ranges = ExtendWordSelectionHandlerBase.expandToWholeLine(editorText, originalRange, false); } } else { ranges = new ArrayList<>(); ranges.add(e.getTextRange()); } SelectWordUtil.addWordOrLexemeSelection(editor.getSettings().isCamelWords(), editor, cursorOffset, ranges); return ranges; }