返回 CodeWhale
lsp.rs
根目录 / crates / tui / src / commands / groups / project / lsp.rs
1 //! `/lsp` command — enable/disable LSP integration.
2 //!
3 //! Bridges to config::config::lsp_command for actual execution.
4
5 use crate::commands::traits::{CommandInfo, RegisterCommand};
6 use crate::localization::MessageId;
7 use crate::tui::app::App;
8
9 use crate::commands::CommandResult;
10
11 pub(in crate::commands) const COMMAND_INFO: CommandInfo = CommandInfo {
12 name: "lsp",
13 aliases: &[],
14 usage: "/lsp [on|off|status]",
15 description_id: MessageId::CmdLspDescription,
16 };
17
18 pub(in crate::commands) struct LspCmd;
19
20 impl RegisterCommand for LspCmd {
21 fn info() -> &'static CommandInfo {
22 &COMMAND_INFO
23 }
24
25 fn execute(app: &mut App, arg: Option<&str>) -> CommandResult {
26 super::super::config::config::lsp_command(app, arg)
27 }
28 }
29
29 lines RUST