fixed PY-11879 Refactor: Rename: references in ivar directive are not updated

This commit is contained in:
Ekaterina Tuzova
2014-01-23 13:51:07 +04:00
parent 100bad79db
commit 7c269602ec
4 changed files with 25 additions and 4 deletions
@@ -19,7 +19,6 @@ import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.AbstractElementManipulator;
import com.jetbrains.python.PythonStringUtil;
import com.jetbrains.python.psi.PyElementGenerator;
/**
* @author traff
@@ -34,9 +33,8 @@ public class PyStringLiteralExpressionManipulator extends AbstractElementManipul
}
String newName = range.replace(element.getText(), newContent);
return (PyStringLiteralExpressionImpl)element
.replace(PyElementGenerator.getInstance(element.getProject()).createStringLiteralAlreadyEscaped(newName));
element.updateText(newName);
return element;
}
@Override
@@ -0,0 +1,9 @@
class SomeClass(object):
""" Awesome class
@ivar someVar: great stuff
@type someVar: string
"""
def __init__(self):
self.some<caret>Var = None
@@ -0,0 +1,9 @@
class SomeClass(object):
""" Awesome class
@ivar bar: great stuff
@type bar: string
"""
def __init__(self):
self.bar = None
@@ -195,6 +195,11 @@ public class PyRenameTest extends PyTestCase {
doMultiFileTest("bar");
}
// PY-11879
public void testDocstringParams() {
doTest("bar");
}
private void doRenameConflictTest(String newName, String expectedConflict) {
myFixture.configureByFile(RENAME_DATA_PATH + getTestName(true) + ".py");
try {