pub use lsp_types;
pub use lsp_types::notification::Notification;
pub use lsp_types::request::Request;
use lsp_types::{DocumentSelector, Url};
use serde::{Deserialize, Serialize};
use serde_json::Value;
pub enum StartLspServer {}
impl Request for StartLspServer {
type Params = StartLspServerParams;
type Result = StartLspServerResult;
const METHOD: &'static str = "host/startLspServer";
}
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StartLspServerParams {
pub server_uri: Url,
pub server_args: Vec<String>,
pub document_selector: DocumentSelector,
pub options: Option<Value>,
}
pub type LspId = u64;
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StartLspServerResult {
pub id: LspId,
}
pub struct SendLspNotification {}
impl Notification for SendLspNotification {
type Params = SendLspNotificationParams;
const METHOD: &'static str = "host/sendLspNotification";
}
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SendLspNotificationParams {
pub id: LspId,
pub method: String,
pub params: Value,
}
pub struct SendLspRequest {}
impl Request for SendLspRequest {
type Params = SendLspRequestParams;
type Result = SendLspRequestResult;
const METHOD: &'static str = "host/sendLspRequest";
}
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SendLspRequestParams {
pub id: LspId,
pub method: String,
pub params: Value,
}
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SendLspRequestResult {
pub result: Value,
}
pub enum ExecuteProcess {}
impl Request for ExecuteProcess {
type Params = ExecuteProcessParams;
type Result = ExecuteProcessResult;
const METHOD: &'static str = "host/executeProcess";
}
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExecuteProcessParams {
pub program: String,
pub args: Vec<String>,
}
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExecuteProcessResult {
pub success: bool,
pub stdout: Option<Vec<u8>>,
pub stderr: Option<Vec<u8>>,
}
pub enum RegisterDebuggerType {}
impl Request for RegisterDebuggerType {
type Params = RegisterDebuggerTypeParams;
type Result = ();
const METHOD: &'static str = "host/registerDebuggerType";
}
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RegisterDebuggerTypeParams {
pub debugger_type: String,
pub program: String,
pub args: Option<Vec<String>>,
}