mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
RSL: string escaper is redundant (IDEA-191095)
This commit is contained in:
+20
@@ -3,6 +3,7 @@ package com.intellij.psi.impl.source.tree.java;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightUtilCore;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.PsiManagerEx;
|
||||
@@ -226,6 +227,25 @@ public class PsiLiteralExpressionImpl
|
||||
@Override
|
||||
@NotNull
|
||||
public LiteralTextEscaper<PsiLiteralExpressionImpl> createLiteralTextEscaper() {
|
||||
if (getLiteralElementType() == JavaTokenType.RAW_STRING_LITERAL) {
|
||||
return new LiteralTextEscaper<PsiLiteralExpressionImpl>(this) {
|
||||
@Override
|
||||
public boolean decode(@NotNull final TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
|
||||
outChars.append(rangeInsideHost.substring(myHost.getText()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetInHost(int offsetInDecoded, @NotNull final TextRange rangeInsideHost) {
|
||||
return offsetInDecoded + rangeInsideHost.getStartOffset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOneLine() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
return new StringLiteralEscaper<>(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user