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
Add postfix completion for let else #15730
Conversation
@rustbot ready |
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.
Super nice PR and auto completions. What do you think of adding the postfix for non-try types as well?
Thanks. I think it could be useful, but it also doesn't exist for |
@Veykril sorry for the ping, but I was wondering if this MR will get another review? I've addressed the last review over 2 months ago and would love for this small improvement to make it into RA. |
Apologies I just don't have time on my hands to go through the PR backlog until january. |
&if in_loop { | ||
format!("let Ok($1) = {receiver_text} else {{\n ${{2|continue,break,return|}};\n}};\n$0") | ||
} else { | ||
format!("let Ok($1) = {receiver_text} else {{\n ${{2:return}};\n}};\n$0") | ||
}, |
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.
&if in_loop { | |
format!("let Ok($1) = {receiver_text} else {{\n ${{2|continue,break,return|}};\n}};\n$0") | |
} else { | |
format!("let Ok($1) = {receiver_text} else {{\n ${{2:return}};\n}};\n$0") | |
}, | |
&format!("let Ok($1) = {receiver_text} else {{\n $0\n}};"), |
Let's not prefill these, there are more options people could strife for. Same for the option one below
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.
I'm a bit sad to lose the convenience, but I see how these could be annoying when you want to do more complex things.
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
17e059d
to
7ec32d0
Compare
@rustbot ready |
Thanks! |
☀️ Test successful - checks-actions |
Adds a postfix completion for let else syntax, similar to the if let postfix.