Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] add custom syn highlight theme from .tmTheme file #6

Open
alexzanderr opened this issue Nov 16, 2022 · 0 comments
Open

[feature] add custom syn highlight theme from .tmTheme file #6

alexzanderr opened this issue Nov 16, 2022 · 0 comments

Comments

@alexzanderr
Copy link

here's a simple example of what I would like, look in the comments

use dbg_pls::{pretty, DebugPls, color};  
  
#[derive(DebugPls, Copy, Clone, Debug)]  
pub struct Demo {  
    foo: i32,  
    bar: &'static str,  
}  
  
fn main() {  
    let mut val = [Demo { foo: 5, bar: "hello" }; 10];  
    val[6].bar = "Hello, world! I am a very long string";  
    
	// to specify a theme file as parameter
	let output = format!("{}", color(&val, "path/to/tmTheme"));  
	println!("{}", output);  
	
	color!(&val, "path/to/tmTheme");  
	
	// and to have a builder pattern to cache the theme load
	// the API doesnt need to be like that, you decide
	let colorizer = Colorizer::new().theme("path/to/tmTheme").build();
	// just pass the object as ref
	let colored_string_repr = colorizer.color(&val);
	// just like color! macro
	colorizer.dbg(&val);	
	// this will print module and line information just like dbg!
}

thats all, in short

i just want to be able to load a custom theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant