Skip to content

Commit

Permalink
Move scarb notifications from scarb.rs to ext.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcticae committed Jan 23, 2025
1 parent 6f9764a commit ab6da3c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
24 changes: 24 additions & 0 deletions src/lsp/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,27 @@ pub mod testing {
const METHOD: &'static str = "cairo/projectUpdatingFinished";
}
}

#[derive(Debug)]
pub struct ScarbPathMissing {}

impl Notification for ScarbPathMissing {
type Params = ();
const METHOD: &'static str = "scarb/could-not-find-scarb-executable";
}

#[derive(Debug)]
pub struct ScarbResolvingStart {}

impl Notification for ScarbResolvingStart {
type Params = ();
const METHOD: &'static str = "scarb/resolving-start";
}

#[derive(Debug)]
pub struct ScarbResolvingFinish {}

impl Notification for ScarbResolvingFinish {
type Params = ();
const METHOD: &'static str = "scarb/resolving-finish";
}
25 changes: 1 addition & 24 deletions src/toolchain/scarb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use tracing::{error, warn};
use which::which;

use crate::env_config;
use crate::lsp::ext::{ScarbPathMissing, ScarbResolvingFinish, ScarbResolvingStart};
use crate::server::client::Notifier;

pub const SCARB_TOML: &str = "Scarb.toml";
Expand Down Expand Up @@ -194,27 +195,3 @@ impl ScarbToolchain {
Ok(version)
}
}

#[derive(Debug)]
struct ScarbPathMissing {}

impl Notification for ScarbPathMissing {
type Params = ();
const METHOD: &'static str = "scarb/could-not-find-scarb-executable";
}

#[derive(Debug)]
struct ScarbResolvingStart {}

impl Notification for ScarbResolvingStart {
type Params = ();
const METHOD: &'static str = "scarb/resolving-start";
}

#[derive(Debug)]
struct ScarbResolvingFinish {}

impl Notification for ScarbResolvingFinish {
type Params = ();
const METHOD: &'static str = "scarb/resolving-finish";
}

0 comments on commit ab6da3c

Please sign in to comment.