use crate::intervals::StyleId;
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DecorationLayerId(pub u32);
impl DecorationLayerId {
pub const INLAY_HINTS: Self = Self(1);
pub const CODE_LENS: Self = Self(2);
pub const DOCUMENT_LINKS: Self = Self(3);
pub const MATCH_HIGHLIGHTS: Self = Self(4);
pub fn new(id: u32) -> Self {
Self(id)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct DecorationRange {
pub start: usize,
pub end: usize,
}
impl DecorationRange {
pub fn new(start: usize, end: usize) -> Self {
Self { start, end }
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DecorationPlacement {
Before,
After,
AboveLine,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum DecorationKind {
InlayHint,
CodeLens,
DocumentLink,
Highlight,
Custom(u32),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Decoration {
pub range: DecorationRange,
pub placement: DecorationPlacement,
pub kind: DecorationKind,
pub text: Option<String>,
pub styles: Vec<StyleId>,
pub tooltip: Option<String>,
pub data_json: Option<String>,
}