decorations

This commit is contained in:
Aleksey Kladov 2018-08-11 00:55:32 +03:00
parent 836e0c1863
commit 9863b9161d
6 changed files with 143 additions and 27 deletions

View file

@ -1,5 +1,7 @@
use serde::{ser::Serialize, de::DeserializeOwned};
use url::Url;
use languageserver_types::{TextDocumentIdentifier, Range};
use url_serde;
pub use languageserver_types::{
request::*, notification::*,
@ -58,3 +60,25 @@ pub struct ExtendSelectionParams {
pub struct ExtendSelectionResult {
pub selections: Vec<Range>,
}
pub enum PublishDecorations {}
impl Notification for PublishDecorations {
type Params = PublishDecorationsParams;
const METHOD: &'static str = "m/publishDecorations";
}
#[derive(Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct PublishDecorationsParams {
#[serde(with = "url_serde")]
pub uri: Url,
pub decorations: Vec<Decoration>,
}
#[derive(Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Decoration {
pub range: Range,
pub tag: &'static str
}