diffuse icon indicating copy to clipboard operation
diffuse copied to clipboard

Add support for Rust syntax highlighting

Open alopatindev opened this issue 4 years ago • 0 comments

Thanks for this awesome tool!

I've been mostly using Rust for the last few years professionally, so I'd love to have Rust highlighting support.

Here's the syntax doc, syntax highlighting implementation for vim, WIP PR and sample code:

#[derive(Clone)]
struct A<'a_bж, B> {
    x: &'a_bж B,
    z: &'static str,
}

trait Tr {}

async fn f(x: Result<(), ()>) -> Result<(), ()> {
    let _ = x?;
    Ok(())
}

async fn g() {
    f(Ok(())).await.unwrap()
}

pub fn main() -> () {
    println!("\x61\x62");
    let mut x: i32 = 1;
    let s: char = 's';
    let x: i32 = -1_322_i32;
    let x: Box<dyn Tr> = todo!();
    let zsd: usize = 123456usize;
    let фыва_1 = "asdf";
    let abra_cadabra_2 = r#"abcd"#;
    let x = 1;
    let asd = r###"sdasd sdf"###;
    let abra_cadabra_2 = r#"multiline
        string
    "#;
    let asd = r###"multiline string
        any characters '"_\/%
        abcd"###;
    return ();
}

alopatindev avatar Jun 23 '21 13:06 alopatindev