MightyCreak / diffuse

Diffuse is a graphical tool for comparing and merging text files. It can retrieve files for comparison from Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion, and SVK repositories.
http://mightycreak.github.io/diffuse/
GNU General Public License v2.0
265 stars 45 forks source link

Add support for Rust syntax highlighting #98

Closed alopatindev closed 1 year ago

alopatindev commented 3 years ago

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 ();
}