Crate vscode_theme_syntect

Crate vscode_theme_syntect 

Source
Expand description

Parse a Visual Studio Code theme into a Syntect Theme.

§Usage

use syntect::highlighting::Theme;
use vscode_theme_syntect::VscodeTheme;
use std::str::FromStr;

let theme = VscodeTheme::from_str(include_str!("../assets/palenight.json")).expect("Failed to parse theme");

assert!(Theme::try_from(theme).is_ok());

Alternatively, you can parse themes using the included utility functions:

Modules§

error
Errors for parsing Visual Studio Code themes

Structs§

TokenColor
A token color
TokenSettings
The settings of a token
VscodeTheme
A Visual Studio Code theme

Enums§

Scope
A scope of a token

Functions§

parse_vscode_theme
Parse a Visual Studio Code theme from a string.
parse_vscode_theme_file
Parse a Visual Studio Code theme from a file.