mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure dots are excluded from applicable name suggestions (IDEA-195113)
This commit is contained in:
+1
-1
@@ -632,7 +632,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
|
||||
final PsiExpression qualifierExpression = methodExpr.getQualifierExpression();
|
||||
if (qualifierExpression instanceof PsiReferenceExpression &&
|
||||
((PsiReferenceExpression)qualifierExpression).resolve() instanceof PsiVariable) {
|
||||
String name = qualifierExpression.getText() + StringUtil.capitalize(propertyName);
|
||||
String name = StringUtil.getShortName(qualifierExpression.getText()) + StringUtil.capitalize(propertyName);
|
||||
return new NamesByExprInfo(propertyName, name);
|
||||
}
|
||||
return new NamesByExprInfo(propertyName);
|
||||
|
||||
@@ -132,6 +132,22 @@ class Car {}
|
||||
assert suggestions == ["car", "optionalCar", "carOptional", "optional", "o"]
|
||||
}
|
||||
|
||||
void "test long qualified name"() {
|
||||
def suggestions = getNameSuggestions("""
|
||||
class Foo {
|
||||
Inner inner;
|
||||
class Inner {
|
||||
String getCat() {}
|
||||
}
|
||||
|
||||
void m(Foo f){
|
||||
String <caret>s = f.inner.getCat();
|
||||
}
|
||||
}
|
||||
""")
|
||||
assert suggestions == ["cat", "innerCat", "s"]
|
||||
}
|
||||
|
||||
private doTestSuggestionAvailable(String text, String... expectedSuggestions) {
|
||||
def suggestions = getNameSuggestions(text)
|
||||
for (String suggestion : expectedSuggestions) {
|
||||
|
||||
Reference in New Issue
Block a user