mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove quotes from string when suggesting name (last remaining part of PY-1276)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user