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
{{ message }}
Repository navigation
switch expression snippet does not show after "return" #4843
changed the title [-]Autocompletion: Add trigger for switch expression after "return" and "=>"[/-][+]switch expression snippet does not show after "return" and "=>"[/+]on Nov 27, 2023
While trying to reproduce this, I noticed some odd behaviour where the items shown in completion can change for the same content. I'll investigate that first, because it might be the cause of some of the issue here:
changed the title [-]switch expression snippet does not show after "return" and "=>"[/-][+]switch expression snippet does not show after "return"[/+]on Nov 29, 2023
Activity
[-]Autocompletion: Add trigger for switch expression after "return" and "=>"[/-][+]switch expression snippet does not show after "return" and "=>"[/+]DanTup commentedon Nov 27, 2023
While trying to reproduce this, I noticed some odd behaviour where the items shown in completion can change for the same content. I'll investigate that first, because it might be the cause of some of the issue here:
#4860
DanTup commentedon Nov 27, 2023
Ignore that - my bug was caused by another existing known issue and unrelated to this.
With that resolved, using the latest SDKs I can only reproduce your second issue (in the return statement). The first example seems to work fine:
Can you confirm your Dart/Flutter SDK version? (and I'll look into the
returnone).simphotonics commentedon Nov 27, 2023
Just updated my Dart SDK from version 3.1.5 to 3.2.0
With version 3.2.0 the
switch expressionentry is indeed presented after=>, but not afterreturn.DanTup commentedon Nov 27, 2023
Great, thanks for confirming. I have a fix open for the return issue at https://dart-review.googlesource.com/c/sdk/+/338401.
[analysis_server] Handle snippet completions correctly in return stat…
DanTup commentedon Nov 27, 2023
Fixed by dart-lang/sdk@7d3020f. The change is in the analysis server so will ship in a future Dart/Flutter SDK.
[-]switch expression snippet does not show after "return" and "=>"[/-][+]switch expression snippet does not show after "return"[/+]