diff --git a/src/config.rs b/src/config.rs index ad9fb69..d03adae 100644 --- a/src/config.rs +++ b/src/config.rs @@ -79,7 +79,7 @@ mod de { } } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] #[serde(deny_unknown_fields)] pub struct Config { #[serde(default = "default::instance_timeout")] diff --git a/src/ext.rs b/src/ext.rs index e43a724..93cf754 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -70,6 +70,12 @@ where } } +pub async fn config() -> Result<()> { + let config = Config::load_or_default().await; + println!("{:?}", config); + Ok(()) +} + pub async fn status(json: bool) -> Result<()> { let res = ext_request::(ext::Request::Status {}).await?; diff --git a/src/main.rs b/src/main.rs index 030b7d5..6d8acda 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,6 +38,9 @@ enum Cmd { json: bool, }, + /// Print server configuration + Config {}, + /// Reload workspace /// /// For rust-analyzer send the `rust-analyzer/reloadWorkspace` extension request. @@ -56,6 +59,7 @@ async fn main() -> anyhow::Result<()> { server_args, }) => proxy::run(server_path, server_args).await, Some(Cmd::Status { json }) => ext::status(json).await, + Some(Cmd::Config {}) => ext::config().await, Some(Cmd::Reload {}) => ext::reload().await, None => { let server_path = env::var("RA_MUX_SERVER").unwrap_or_else(|_| "rust-analyzer".into());