feat: add a basic lsp
This commit is contained in:
13
crates/cli/src/cmd/lsp.rs
Normal file
13
crates/cli/src/cmd/lsp.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use miette::IntoDiagnostic;
|
||||
|
||||
#[derive(clap::Args)]
|
||||
/// Start the Aiken language server
|
||||
pub struct Args {
|
||||
/// Run on stdio
|
||||
#[clap(long)]
|
||||
stdio: bool,
|
||||
}
|
||||
|
||||
pub fn exec(_args: Args) -> miette::Result<()> {
|
||||
aiken_lsp::start().into_diagnostic()
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod build;
|
||||
pub mod check;
|
||||
pub mod fmt;
|
||||
pub mod lsp;
|
||||
pub mod new;
|
||||
pub mod tx;
|
||||
pub mod uplc;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aiken::cmd::{build, check, fmt, new, tx, uplc};
|
||||
use aiken::cmd::{build, check, fmt, lsp, new, tx, uplc};
|
||||
use clap::Parser;
|
||||
|
||||
/// Aiken: a smart-contract language and toolchain for Cardano
|
||||
@@ -12,6 +12,9 @@ pub enum Cmd {
|
||||
Build(build::Args),
|
||||
Check(check::Args),
|
||||
|
||||
#[clap(hide = true)]
|
||||
Lsp(lsp::Args),
|
||||
|
||||
#[clap(subcommand)]
|
||||
Tx(tx::Cmd),
|
||||
|
||||
@@ -32,6 +35,7 @@ fn main() -> miette::Result<()> {
|
||||
Cmd::Fmt(args) => fmt::exec(args),
|
||||
Cmd::Build(args) => build::exec(args),
|
||||
Cmd::Check(args) => check::exec(args),
|
||||
Cmd::Lsp(args) => lsp::exec(args),
|
||||
Cmd::Tx(sub_cmd) => tx::exec(sub_cmd),
|
||||
Cmd::Uplc(sub_cmd) => uplc::exec(sub_cmd),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user