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

View File

@@ -14,12 +14,13 @@ clap = { version = "3.1.14", features = ["derive"] }
hex = "0.4.3"
ignore = "0.4.18"
miette = { version = "5.3.0", features = ["fancy"] }
pallas-addresses = "0.14.0-alpha.3"
pallas-codec = "0.14.0-alpha.3"
pallas-crypto = "0.14.0-alpha.3"
pallas-primitives = "0.14.0-alpha.3"
pallas-traverse = "0.14.0-alpha.3"
pallas-addresses = "0.14.0"
pallas-codec = "0.14.0"
pallas-crypto = "0.14.0"
pallas-primitives = "0.14.0"
pallas-traverse = "0.14.0"
aiken-lang = { path = "../lang", version = "0.0.24" }
aiken-lsp = { path = "../lsp", version = "0.0.0" }
aiken-project = { path = '../project', version = "0.0.24" }
uplc = { path = '../uplc', version = "0.0.24" }

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