Port zed/src/languages to zed2

This commit is contained in:
Julia 2023-10-30 21:41:17 -04:00
parent 58446c2715
commit db34de6be4
191 changed files with 9448 additions and 182 deletions

View file

@ -108,6 +108,24 @@ pub struct SyntaxTheme {
}
impl SyntaxTheme {
// TOOD: Get this working with `#[cfg(test)]`. Why isn't it?
pub fn new_test(colors: impl IntoIterator<Item = (&'static str, Hsla)>) -> Self {
SyntaxTheme {
highlights: colors
.into_iter()
.map(|(key, color)| {
(
key.to_owned(),
HighlightStyle {
color: Some(color),
..Default::default()
},
)
})
.collect(),
}
}
pub fn get(&self, name: &str) -> HighlightStyle {
self.highlights
.iter()