TextRange (PsiLanguageInjectionHost host) { ASTNode[] children = host.getNode().getChildren(null); TextRange insideQuotes = new ProperTextRange(0, host.getTextLength()); if (children.length > 1 && children[0].getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER) { insideQuotes = new ProperTextRange(children[1].getTextRange().getStartOffset() - host.getTextRange().getStartOffset(), insideQuotes.getEndOffset()); } if (children.length > 1 && children[children.length-1].getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER) { insideQuotes = new ProperTextRange(insideQuotes.getStartOffset(), children[children.length-2].getTextRange().getEndOffset() - host.getTextRange().getStartOffset()); } if (host instanceof PsiLiteralExpression) { insideQuotes = new ProperTextRange(1, host.getTextLength()-1); } return insideQuotes; }