mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-22509 - IOE: StringLiteralManipulator.handleContentChange logging
This commit is contained in:
+2
-1
@@ -28,7 +28,8 @@ import com.intellij.util.IncorrectOperationException;
|
||||
*/
|
||||
public class StringLiteralManipulator extends AbstractElementManipulator<PsiLiteralExpression> {
|
||||
public PsiLiteralExpression handleContentChange(PsiLiteralExpression expr, TextRange range, String newContent) throws IncorrectOperationException {
|
||||
if (!(expr.getValue() instanceof String)) throw new IncorrectOperationException("cannot handle content change");
|
||||
final Object value = expr.getValue();
|
||||
if (!(value instanceof String)) throw new IncorrectOperationException("cannot handle content change for: "+ value);
|
||||
String oldText = expr.getText();
|
||||
newContent = StringUtil.escapeStringCharacters(newContent);
|
||||
String newText = oldText.substring(0, range.getStartOffset()) + newContent + oldText.substring(range.getEndOffset());
|
||||
|
||||
Reference in New Issue
Block a user