chore: change compile command to trace-lsp (#447)

This commit is contained in:
Myriad-Dreamin 2024-07-22 14:28:57 +08:00 committed by GitHub
parent 5b7794a587
commit ede592796d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View file

@ -15,8 +15,9 @@ pub struct CliArguments {
pub enum Commands {
/// Run Language Server
Lsp(LspArgs),
/// Run Compile Server
Compile(CompileArgs),
/// Run Language Server for tracing some typst program.
#[clap(hide(true))]
TraceLsp(CompileArgs),
/// Run Preview Server
#[cfg(feature = "preview")]
Preview(tinymist::tool::preview::PreviewCliArgs),

View file

@ -68,7 +68,7 @@ fn main() -> anyhow::Result<()> {
match args.command.unwrap_or_default() {
Commands::Lsp(args) => lsp_main(args),
Commands::Compile(args) => compiler_main(args),
Commands::TraceLsp(args) => trace_main(args),
#[cfg(feature = "preview")]
Commands::Preview(args) => {
#[cfg(feature = "preview")]
@ -104,7 +104,7 @@ pub fn lsp_main(args: LspArgs) -> anyhow::Result<()> {
}
/// The main entry point for the compiler.
pub fn compiler_main(args: CompileArgs) -> anyhow::Result<()> {
pub fn trace_main(args: CompileArgs) -> anyhow::Result<()> {
let mut input = PathBuf::from(match args.compile.input {
Some(value) => value,
None => return Err(anyhow::Error::msg("Provide a valid path")),

View file

@ -39,7 +39,7 @@ async fn run_trace_program(params: TraceParams) -> anyhow::Result<TraceReport> {
let mut cmd = tokio::process::Command::new(&params.compiler_program);
let mut cmd = &mut cmd;
cmd = cmd.arg("compile");
cmd = cmd.arg("trace-lsp");
cmd = cmd
.arg("--root")

View file

@ -43,7 +43,7 @@ pub struct CompileFontArgs {
/// Common arguments of compile, watch, and query.
#[derive(Debug, Clone, Parser, Default)]
pub struct CompileOnceArgs {
/// Path to input Typst file, use `-` to read input from stdin
/// Path to input Typst file
#[clap(value_name = "INPUT")]
pub input: Option<String>,