Clean up unused code

This commit is contained in:
Marshall Bowers 2023-11-02 19:20:21 -04:00
parent 152ac6927f
commit 95a0827517
2 changed files with 2 additions and 51 deletions

View File

@ -18,16 +18,6 @@ use vscode::VsCodeThemeConverter;
use crate::theme_printer::ThemeFamilyPrinter;
use crate::vscode::VsCodeTheme;
pub(crate) fn new_theme_family(name: String, author: String) -> ThemeFamily {
ThemeFamily {
id: uuid::Uuid::new_v4().to_string(),
name: name.into(),
author: author.into(),
themes: Vec::new(),
scales: default_color_scales(),
}
}
#[derive(Debug, Deserialize)]
struct FamilyMetadata {
pub name: String,

View File

@ -1,14 +1,10 @@
use std::path::{Path, PathBuf};
use anyhow::Result;
use gpui::{Hsla, Refineable, Rgba};
use serde::Deserialize;
use theme::{
default_color_scales, Appearance, ColorScales, GitStatusColors, PlayerColors, StatusColors,
SyntaxTheme, SystemColors, ThemeColors, ThemeColorsRefinement, ThemeFamily, ThemeStyles,
ThemeVariant,
Appearance, GitStatusColors, PlayerColors, StatusColors, SyntaxTheme, SystemColors,
ThemeColors, ThemeColorsRefinement, ThemeStyles, ThemeVariant,
};
use uuid::Uuid;
use crate::ThemeMetadata;
@ -34,41 +30,6 @@ pub struct VsCodeColors {
editor: String,
}
pub(crate) fn new_theme_family_from_vsc(path: &Path) -> Result<ThemeFamily> {
todo!()
// let path_str = path.to_str().unwrap();
// let family_name = path_str.split('/').last().unwrap();
// let mut json_files: Vec<String> = Vec::new();
// if path.is_dir() {
// for entry in std::fs::read_dir(path).unwrap() {
// let entry = entry.unwrap();
// let path = entry.path();
// if path.is_file() {
// if let Some(extension) = path.extension() {
// if extension == "json" {
// json_files.push(path.file_name().unwrap().to_str().unwrap().to_string());
// }
// }
// }
// }
// } else {
// anyhow::bail!("Path is not a directory");
// }
// let mut theme_family = ThemeFamily {
// id: uuid::Uuid::new_v4().to_string(),
// name: family_name.into(),
// author: "New Theme Family".into(),
// themes: Vec::new(),
// scales: default_color_scales(),
// };
// Ok(theme_family)
}
fn try_parse_color(color: &str) -> Result<Hsla> {
Ok(Rgba::try_from(color)?.into())
}