Add runnables

This commit is contained in:
Aleksey Kladov 2018-08-27 22:03:19 +03:00
parent b79c8b6d8a
commit 5751815314
7 changed files with 115 additions and 2 deletions

View file

@ -1,3 +1,5 @@
use std::collections::HashMap;
use serde::{ser::Serialize, de::DeserializeOwned};
use languageserver_types::{TextDocumentIdentifier, Range, Url, Position, Location};
use url_serde;
@ -134,3 +136,28 @@ pub struct JoinLinesParams {
pub text_document: TextDocumentIdentifier,
pub range: Range,
}
pub enum Runnables {}
impl Request for Runnables {
type Params = RunnablesParams;
type Result = Vec<Runnable>;
const METHOD: &'static str = "m/joinLines";
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct RunnablesParams {
pub text_document: TextDocumentIdentifier,
pub position: Option<Position>,
}
#[derive(Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Runnable {
pub range: Range,
pub label: String,
pub bin: String,
pub args: Vec<String>,
pub env: HashMap<String, String>,
}