mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
typo
IDEA-CR-31776
This commit is contained in:
+4
-4
@@ -67,11 +67,11 @@ public class ConvertStringLiteralToRawAction implements IntentionAction, LowPrio
|
||||
prefix = "\"" + StringUtil.repeat("`", startingSeq) + "\" + ";
|
||||
}
|
||||
String suffix = "";
|
||||
int tailingSequence = PsiRawStringLiteralUtil.getTailingTicsSequence(text);
|
||||
if (tailingSequence > 0) {
|
||||
suffix = "+ \"" + StringUtil.repeat("`", tailingSequence) + "\"";
|
||||
int trailingSequence = PsiRawStringLiteralUtil.getTrailingTicsSequence(text);
|
||||
if (trailingSequence > 0) {
|
||||
suffix = "+ \"" + StringUtil.repeat("`", trailingSequence) + "\"";
|
||||
}
|
||||
String textTicsTrimmed = text.substring(Math.max(startingSeq, 0), text.length() - Math.max(tailingSequence, 0));
|
||||
String textTicsTrimmed = text.substring(Math.max(startingSeq, 0), text.length() - Math.max(trailingSequence, 0));
|
||||
String additionalQuotes = PsiRawStringLiteralUtil.getAdditionalTics(textTicsTrimmed, "`");
|
||||
PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
|
||||
CodeStyleManager.getInstance(project).reformat(
|
||||
|
||||
+4
-4
@@ -43,7 +43,7 @@ public class RawStringLiteralPasteProcessor implements PasteProvider {
|
||||
if (stringLiteral == null) return;
|
||||
|
||||
int leadingTicsSequence = PsiRawStringLiteralUtil.getLeadingTicsSequence(text);
|
||||
int tailingTicsSequence = PsiRawStringLiteralUtil.getTailingTicsSequence(text);
|
||||
int trailingTicsSequence = PsiRawStringLiteralUtil.getTrailingTicsSequence(text);
|
||||
|
||||
String prefix = "";
|
||||
TextRange textRange = stringLiteral.getTextRange();
|
||||
@@ -53,9 +53,9 @@ public class RawStringLiteralPasteProcessor implements PasteProvider {
|
||||
}
|
||||
|
||||
String suffix = "";
|
||||
if (offset == textRange.getEndOffset() - 1 && tailingTicsSequence > 0) {
|
||||
suffix = "+ \"" + StringUtil.repeat("`", tailingTicsSequence) + "\"";
|
||||
text = text.substring(0, text.length() - tailingTicsSequence);
|
||||
if (offset == textRange.getEndOffset() - 1 && trailingTicsSequence > 0) {
|
||||
suffix = "+ \"" + StringUtil.repeat("`", trailingTicsSequence) + "\"";
|
||||
text = text.substring(0, text.length() - trailingTicsSequence);
|
||||
}
|
||||
|
||||
String literalText = stringLiteral.getText();
|
||||
|
||||
@@ -35,9 +35,9 @@ public class PsiRawStringLiteralUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of tailing tics in the <code>text</code>
|
||||
* Return number of trailing tics in the <code>text</code>
|
||||
*/
|
||||
public static int getTailingTicsSequence(String text) {
|
||||
public static int getTrailingTicsSequence(String text) {
|
||||
int length = text.length();
|
||||
while (length > 0 && text.charAt(length - 1) == '`') length--;
|
||||
return text.length() - length;
|
||||
|
||||
Reference in New Issue
Block a user