lsp server test
This commit is contained in:
@@ -9,3 +9,6 @@ edition = "2021"
|
||||
regex = "1.10.4"
|
||||
once_cell = "1.19.0"
|
||||
clap = { version = "4.0", features = ["derive"] }
|
||||
lspower = "1.5.0"
|
||||
tokio = { version = "1.38.0", features = ["full"] }
|
||||
tokio-macros = "2.3.0"
|
||||
+14
-4
@@ -2,27 +2,35 @@ mod transpiler;
|
||||
mod parser;
|
||||
mod lexer;
|
||||
mod compile;
|
||||
mod lsp;
|
||||
use std::{fs, path::Path};
|
||||
use clap::Parser;
|
||||
use lexer::LexerState;
|
||||
use transpiler::Options;
|
||||
|
||||
use crate::lsp::run_lsp_server;
|
||||
|
||||
// Arguments for Wyst (short and long version)
|
||||
#[derive(Parser)]
|
||||
struct Args {
|
||||
#[clap()]
|
||||
file: std::path::PathBuf,
|
||||
|
||||
#[clap(short, long)]
|
||||
rust: Option<String>,
|
||||
|
||||
#[clap(short, long)]
|
||||
compile: Option<String>,
|
||||
|
||||
#[clap(long)]
|
||||
stdio: bool,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let args = Args::parse();
|
||||
let file_content = fs::read_to_string(&args.file)
|
||||
match args.stdio {
|
||||
true => {
|
||||
run_lsp_server();
|
||||
},
|
||||
false => {
|
||||
let file_content = fs::read_to_string("main.wt")
|
||||
.expect("Error reading file");
|
||||
if Path::new("build").exists() {
|
||||
fs::remove_dir_all("build").expect("err rm build");
|
||||
@@ -55,4 +63,6 @@ fn main() {
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user