feat: add dap symbols to config
This commit is contained in:
parent
a8ffbaa397
commit
e9de73a4a3
2 changed files with 31 additions and 3 deletions
|
@ -2,14 +2,13 @@ use std::collections::HashMap;
|
|||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
// TODO: Dap: verified ●, unverified ◯
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone)]
|
||||
pub struct Icons {
|
||||
pub mime: Mime,
|
||||
pub lsp: Lsp,
|
||||
pub diagnostic: Diagnostic,
|
||||
pub vcs: Vcs,
|
||||
pub dap: Dap,
|
||||
}
|
||||
|
||||
// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentSymbol
|
||||
|
@ -248,3 +247,26 @@ impl Mime {
|
|||
self.mime.get(mime).map_or("*", |mime| mime)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Default)]
|
||||
pub struct Dap {
|
||||
verified: Option<String>,
|
||||
unverified: Option<String>,
|
||||
}
|
||||
|
||||
impl Dap {
|
||||
const DEFAULT_VERIFIED: &'static str = "●";
|
||||
const DEFAULT_UNVERIFIED: &'static str = "◯";
|
||||
|
||||
pub fn verified(&self) -> &str {
|
||||
self.verified
|
||||
.as_ref()
|
||||
.map_or(Self::DEFAULT_VERIFIED, |verified| verified)
|
||||
}
|
||||
|
||||
pub fn unverified(&self) -> &str {
|
||||
self.verified
|
||||
.as_ref()
|
||||
.map_or(Self::DEFAULT_UNVERIFIED, |verified| verified)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -274,7 +274,13 @@ pub fn breakpoints<'doc>(
|
|||
breakpoint_style
|
||||
};
|
||||
|
||||
let sym = if breakpoint.verified { "●" } else { "◯" };
|
||||
let config = editor.config();
|
||||
|
||||
let sym = if breakpoint.verified {
|
||||
config.icons.dap.verified()
|
||||
} else {
|
||||
config.icons.dap.unverified()
|
||||
};
|
||||
write!(out, "{}", sym).unwrap();
|
||||
Some(style)
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue