zoi_cli/cmd/package/
init_lsp.rs1use anyhow::Result;
4use clap::Parser;
5use colored::Colorize;
6
7#[derive(Parser, Debug)]
9pub struct InitLspCommand {
10 #[arg(default_value = ".")]
12 pub path: std::path::PathBuf
13}
14
15pub fn run(args: &InitLspCommand) -> Result<()> {
25 println!(
26 "{} Initializing LSP support in {}...",
27 "::".bold().blue(),
28 args.path.display()
29 );
30
31 crate::pkg::package::init_lsp::setup_lsp_workspace(&args.path)?;
32
33 println!(
34 "{} LSP support initialized. Created .luarc.json and type definitions.",
35 "::".bold().green()
36 );
37 println!(
38 "{} Use 'lua-language-server' for rich autocomplete and documentation.",
39 "Note:".yellow()
40 );
41
42 Ok(())
43}