TextRange (PsiElement element) { final Matcher matcher = NAME_PATTERN.matcher(element.getText()); if (matcher.find()) { return TextRange.create(matcher.start(), matcher.end()); } else { return null; } }