remove quotes from string when suggesting name (last remaining part of PY-1276)

This commit is contained in:
Dmitry Jemerov
2011-01-25 15:26:56 +01:00
parent b24337d47d
commit a495eeb447
3 changed files with 6 additions and 1 deletions
@@ -23,7 +23,7 @@ public class NameSuggestorUtil {
@NotNull
public static Collection<String> generateNames(@NotNull String name) {
name = StringUtil.decapitalize(deleteNonLetterFromString(name.replace('.', '_')));
name = StringUtil.decapitalize(deleteNonLetterFromString(StringUtil.unquoteString(name.replace('.', '_'))));
if (name.startsWith("get")) {
name = name.substring(3);
}
@@ -0,0 +1 @@
"foo <caret>bar"
@@ -36,6 +36,10 @@ public class PyIntroduceVariableTest extends PyLightFixtureTestCase {
doTestSuggestions(PyCallExpression.class, "my_class");
}
public void testSuggestStringConstantValue() { // PY-1276
doTestSuggestions(PyExpression.class, "foo_bar");
}
private void doTestSuggestions(Class<? extends PyExpression> parentClass, String... expectedNames) {
myFixture.configureByFile("/refactoring/introduceVariable/" + getTestName(true) + ".py");
VariableIntroduceHandler handler = new VariableIntroduceHandler();