Editor docs (#4097)
Release Notes: - N/A --------- Co-authored-by: Kirill <kirill@zed.dev>
This commit is contained in:
parent
647b08b101
commit
6cbc49e5f0
49 changed files with 507 additions and 376 deletions
|
@ -53,39 +53,46 @@ pub fn app_menus() -> Vec<Menu<'static>> {
|
|||
Menu {
|
||||
name: "Edit",
|
||||
items: vec![
|
||||
MenuItem::os_action("Undo", editor::Undo, OsAction::Undo),
|
||||
MenuItem::os_action("Redo", editor::Redo, OsAction::Redo),
|
||||
MenuItem::os_action("Undo", editor::actions::Undo, OsAction::Undo),
|
||||
MenuItem::os_action("Redo", editor::actions::Redo, OsAction::Redo),
|
||||
MenuItem::separator(),
|
||||
MenuItem::os_action("Cut", editor::Cut, OsAction::Cut),
|
||||
MenuItem::os_action("Copy", editor::Copy, OsAction::Copy),
|
||||
MenuItem::os_action("Paste", editor::Paste, OsAction::Paste),
|
||||
MenuItem::os_action("Cut", editor::actions::Cut, OsAction::Cut),
|
||||
MenuItem::os_action("Copy", editor::actions::Copy, OsAction::Copy),
|
||||
MenuItem::os_action("Paste", editor::actions::Paste, OsAction::Paste),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Find", search::buffer_search::Deploy { focus: true }),
|
||||
MenuItem::action("Find In Project", workspace::NewSearch),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Toggle Line Comment", editor::ToggleComments::default()),
|
||||
MenuItem::action("Emoji & Symbols", editor::ShowCharacterPalette),
|
||||
MenuItem::action(
|
||||
"Toggle Line Comment",
|
||||
editor::actions::ToggleComments::default(),
|
||||
),
|
||||
MenuItem::action("Emoji & Symbols", editor::actions::ShowCharacterPalette),
|
||||
],
|
||||
},
|
||||
Menu {
|
||||
name: "Selection",
|
||||
items: vec![
|
||||
MenuItem::os_action("Select All", editor::SelectAll, OsAction::SelectAll),
|
||||
MenuItem::action("Expand Selection", editor::SelectLargerSyntaxNode),
|
||||
MenuItem::action("Shrink Selection", editor::SelectSmallerSyntaxNode),
|
||||
MenuItem::os_action(
|
||||
"Select All",
|
||||
editor::actions::SelectAll,
|
||||
OsAction::SelectAll,
|
||||
),
|
||||
MenuItem::action("Expand Selection", editor::actions::SelectLargerSyntaxNode),
|
||||
MenuItem::action("Shrink Selection", editor::actions::SelectSmallerSyntaxNode),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Add Cursor Above", editor::AddSelectionAbove),
|
||||
MenuItem::action("Add Cursor Below", editor::AddSelectionBelow),
|
||||
MenuItem::action("Add Cursor Above", editor::actions::AddSelectionAbove),
|
||||
MenuItem::action("Add Cursor Below", editor::actions::AddSelectionBelow),
|
||||
MenuItem::action(
|
||||
"Select Next Occurrence",
|
||||
editor::SelectNext {
|
||||
editor::actions::SelectNext {
|
||||
replace_newest: false,
|
||||
},
|
||||
),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Move Line Up", editor::MoveLineUp),
|
||||
MenuItem::action("Move Line Down", editor::MoveLineDown),
|
||||
MenuItem::action("Duplicate Selection", editor::DuplicateLine),
|
||||
MenuItem::action("Move Line Up", editor::actions::MoveLineUp),
|
||||
MenuItem::action("Move Line Down", editor::actions::MoveLineDown),
|
||||
MenuItem::action("Duplicate Selection", editor::actions::DuplicateLine),
|
||||
],
|
||||
},
|
||||
Menu {
|
||||
|
@ -124,13 +131,13 @@ pub fn app_menus() -> Vec<Menu<'static>> {
|
|||
MenuItem::action("Go to File", file_finder::Toggle),
|
||||
// MenuItem::action("Go to Symbol in Project", project_symbols::Toggle),
|
||||
MenuItem::action("Go to Symbol in Editor", outline::Toggle),
|
||||
MenuItem::action("Go to Definition", editor::GoToDefinition),
|
||||
MenuItem::action("Go to Type Definition", editor::GoToTypeDefinition),
|
||||
MenuItem::action("Find All References", editor::FindAllReferences),
|
||||
MenuItem::action("Go to Definition", editor::actions::GoToDefinition),
|
||||
MenuItem::action("Go to Type Definition", editor::actions::GoToTypeDefinition),
|
||||
MenuItem::action("Find All References", editor::actions::FindAllReferences),
|
||||
MenuItem::action("Go to Line/Column", go_to_line::Toggle),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Next Problem", editor::GoToDiagnostic),
|
||||
MenuItem::action("Previous Problem", editor::GoToPrevDiagnostic),
|
||||
MenuItem::action("Next Problem", editor::actions::GoToDiagnostic),
|
||||
MenuItem::action("Previous Problem", editor::actions::GoToPrevDiagnostic),
|
||||
],
|
||||
},
|
||||
Menu {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use anyhow::{anyhow, Context, Result};
|
||||
use cli::{ipc, IpcHandshake};
|
||||
use cli::{ipc::IpcSender, CliRequest, CliResponse};
|
||||
use editor::scroll::autoscroll::Autoscroll;
|
||||
use editor::scroll::Autoscroll;
|
||||
use editor::Editor;
|
||||
use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender};
|
||||
use futures::channel::{mpsc, oneshot};
|
||||
|
|
|
@ -730,7 +730,7 @@ fn open_bundled_file(
|
|||
mod tests {
|
||||
use super::*;
|
||||
use assets::Assets;
|
||||
use editor::{scroll::autoscroll::Autoscroll, DisplayPoint, Editor, EditorEvent};
|
||||
use editor::{scroll::Autoscroll, DisplayPoint, Editor, EditorEvent};
|
||||
use gpui::{
|
||||
actions, Action, AnyWindowHandle, AppContext, AssetSource, Entity, TestAppContext,
|
||||
VisualTestContext, WindowHandle,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue