You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is one of the parts of Autocompletion I find most annoying. Totally agree this is an issue.
The reasons that this is hard to solve are unfortunately many-fold:
The receiver in this case isn't actually the #yourself symbol that type-inference thinks it is.
In fact, the receiver could be either the #yourself, or the #(), depending on what symbol to suggest
This makes it very hard to figure out correctly, as we'd need to:
Find all possible receivers
For continuation of existing selectors
Depending on precedence (Receivers for n-ary functions can be different than for binary functions or unary functions *)
For each potential receiver, inject the valid selectors (and only those valid in this context) into the suggestions
When completing, only inject the missing parts of the selector
In this case the selector do: displayingProgress: is actually even inserted correctly. #yourself is a collection, so you can indeed call do: displayingProgress on it!
The correct solution here would probably actually be to suggest both: do:displayingProgress: on #yourself and then inserting parentheses:
#()do: (#yourselfdo: ___ displayingProgress: ___)
and also suggest displayingProgress: separately.
* Determining the receiver for a common comparison is actually stupidly difficult
conditions addLast:1>5"| <--- CURSOR"" ^ receiver for unary messages (e.g. negated) or maybe n-ary messages when adding parens"" ^^^^^ receiver for binary messages (e.g. &) or maybe n-ary messages (e.g. and:), when adding parens""^^^^^^^^^ receiver for certain n-ary messages due to continuation (e.g. addLast:times:)"
Any suggestions to handle this in a sane way are highly welcome 🙈
Example:
becomes:
instead of:
Would be very useful!
The text was updated successfully, but these errors were encountered: