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
But I found that in some editors (e.g. emacs), it conflicts with the editor's own bracket auto-pairing:
fn main(){let x = Some(0);letSome(x) = x else{| // insert { here}// ==>fn main(){let x = Some(0);letSome(x) = x else{|
};// the semicolon was inserted here :(
The } for fn is parsed to be paired with the preceding {.
roife
changed the title
feat request: auto-insert semicolon in let-else statements
auto-insert semicolon in let-else statements
Dec 9, 2024
Hmm that does sound tricky relying on bracket completion by the editor here. I don't think having a typing handler for that sounds good (I added a couple of things to the on typing handler recently and they all seemed to worsen the UX experience...).
An assist sounds reasonable, it would be in a similar vein to the other case splitting ideas I think? (just for let else, not if let / match)
It would be very convenient if the
;
were automatically added when typing{
inlet-else
statements; I often forget it. :)The text was updated successfully, but these errors were encountered: