-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Format selection #16823
Format selection #16823
Conversation
# Conflicts: # crates/editor/src/mouse_context_menu.rs # crates/project/src/project.rs
# Conflicts: # crates/project/src/project.rs
ea947a9
to
8cbb245
Compare
8cbb245
to
35779b2
Compare
None => return None, | ||
}; | ||
|
||
let selections = self |
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.
Is there an ideomatic way to get a multiselection without a cursor with a single char?
@@ -169,6 +177,9 @@ pub fn deploy_context_menu( | |||
.separator() | |||
.action("Rename Symbol", Box::new(Rename)) | |||
.action("Format Buffer", Box::new(Format)) | |||
.when(!selections, |builder| { |
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.
Should the button be shown only when a LSP supports range formatting or something? Maybe something like a flag in settings a-la formatSelectionEnabled: true
?
@terziele Sorry for the slow reply here! This is something that we want, but the code around language servers is very in flux as we rebuild remoting for SSH. I am going to close this, but if you want to rebase onto latest main in a few days, that would be fantastic. @mikayla-maki and I are about to shred the formatting code again, so wait until that lands :D Otherwise if you'd like to pair on it: https://calendly.com/conradirwin/pairing |
@ConradIrwin Hey, thanks for reply! |
@ConradIrwin Hey, just made a PR for formatting #18752 |
Adding a new
Format Selection
action to a mouse context menu. As discussed here #16080Release Notes:
Format Selection
action to a mouse context menu.