-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fixes autocomplete not working in valid positions because of a Java iterable INTELLIJ-158 #113
Conversation
method.containingClass?.qualifiedName == JAVA_LIST_FQN | ||
|
||
val isArrayAsListCall = method?.name == "asList" && | ||
method.containingClass?.qualifiedName == JAVA_ARRAYS_FQN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other ways to define iterables in Java, maybe instead of checking the class of the method, we can check the return type is a Collection or an array? Collections.singletonList is also another way.
I don't think we need to support all possible factory methods right now, but if the cost of supporting them is low I would try it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this over Slack - Checking the return type of the expression is the sure shot way for inferring wether the expression is a Java Iterable or not but then it would also "accidentally" cover cases for iterables that could potentially be modified such as iterables created with new ArrayList
interface. For now we decided to rename the interface to isParseableJavaIterable
to abstract away how we identify the iterable. It also now support Collections.singletonList
(71a30ef)
0ee1c10
to
0e6ad08
Compare
Coverage Report
|
🤖 Benchmark Comparison for
|
Description
AC was not working in cases where a valid MethodCallExpression was having a Java Iterable as an argument. This PR fixes that by handling the case of Java Iterable and traversing upwards to determine whether a caret position qualifies for AC or not.
Checklist
Open Questions