Add Format Buffer
action to mouse context menu (#16080)
Closes #15891 Release Notes: - Added "Format Buffer" action to the right-click menu within a buffer. --------- Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
parent
783cccf95d
commit
12dda5fa1b
1 changed files with 5 additions and 5 deletions
|
@ -1,11 +1,10 @@
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
|
|
||||||
use crate::GoToDeclaration;
|
|
||||||
use crate::{
|
use crate::{
|
||||||
selections_collection::SelectionsCollection, Copy, CopyPermalinkToLine, Cut, DisplayPoint,
|
actions::Format, selections_collection::SelectionsCollection, Copy, CopyPermalinkToLine, Cut,
|
||||||
DisplaySnapshot, Editor, EditorMode, FindAllReferences, GoToDefinition, GoToImplementation,
|
DisplayPoint, DisplaySnapshot, Editor, EditorMode, FindAllReferences, GoToDeclaration,
|
||||||
GoToTypeDefinition, Paste, Rename, RevealInFileManager, SelectMode, ToDisplayPoint,
|
GoToDefinition, GoToImplementation, GoToTypeDefinition, Paste, Rename, RevealInFileManager,
|
||||||
ToggleCodeActions,
|
SelectMode, ToDisplayPoint, ToggleCodeActions,
|
||||||
};
|
};
|
||||||
use gpui::prelude::FluentBuilder;
|
use gpui::prelude::FluentBuilder;
|
||||||
use gpui::{DismissEvent, Pixels, Point, Subscription, View, ViewContext};
|
use gpui::{DismissEvent, Pixels, Point, Subscription, View, ViewContext};
|
||||||
|
@ -174,6 +173,7 @@ pub fn deploy_context_menu(
|
||||||
deployed_from_indicator: None,
|
deployed_from_indicator: None,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
.action("Format Buffer", Box::new(Format))
|
||||||
.separator()
|
.separator()
|
||||||
.action("Cut", Box::new(Cut))
|
.action("Cut", Box::new(Cut))
|
||||||
.action("Copy", Box::new(Copy))
|
.action("Copy", Box::new(Copy))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue