correct referenced name for escaped identifiers

This commit is contained in:
Dmitry Jemerov
2011-05-26 13:43:46 +04:00
parent 93b30bd7c7
commit 6c9e54d870
@@ -24,7 +24,14 @@ public class JetSimpleNameExpression extends JetReferenceExpression {
@Nullable @IfNotParsed
public String getReferencedName() {
PsiElement referencedNameElement = getReferencedNameElement();
return referencedNameElement == null ? null : referencedNameElement.getNode().getText();
if (referencedNameElement == null) {
return null;
}
final String text = referencedNameElement.getNode().getText();
if (text.startsWith("`") && text.endsWith("`") && text.length() >= 2) {
return text.substring(1, text.length()-1);
}
return text;
}
@Nullable @IfNotParsed