feat: add a basic lsp

This commit is contained in:
rvcas
2022-11-10 01:03:41 -05:00
committed by Lucas
parent e421b49ab2
commit e90a210537
7 changed files with 377 additions and 16 deletions

13
crates/cli/src/cmd/lsp.rs Normal file
View 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()
}

View File

@@ -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;

View File

@@ -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),
}