Command

Derive Macro Command 

Source
#[derive(Command)]
{
    // Attributes available to this derive:
    #[command]
}
Expand description

This macro implements the Command trait for a given type. the #[command(title = "...")] attribute can be used to define the title of the command on enum variants or structs.

ยงExample

use sync_lsp::workspace::execute_command::Command;
 
#[derive(Clone, Command)]
#[command(title = "My command without variants or arguments")]
struct MyCommand;
use sync_lsp::workspace::execute_command::Command;
 
#[derive(Clone, Command)]
enum MyCommand {
    #[command(title = "My first command")]
    MyCommand,
    #[command(title = "My command with arguments")]
    MyCommandWithArguments(u32),
}