rune-rs / rune

An embeddable dynamic programming language for Rust.
https://rune-rs.github.io
Apache License 2.0
1.7k stars 85 forks source link

Formatting screwup on inline block comment #742

Closed VorpalBlade closed 3 weeks ago

VorpalBlade commented 1 month ago

This rune code:


impl System {
    pub fn new(sysinfo /* sysinfo::SysInfo */) {
        // ...
    }
}

gets auto-formatted to this invalid rune code:


impl System { /* sysinfo::SysInfo *
    pub fn new(sysinfo) {
    // ...
    }
}

This happens both with the rune cli and with vscode.

Rune 0.13.3

VorpalBlade commented 1 month ago

Hm it seems block comments are more broken than just inline as above:

fn setup_system_users(system, features, tasks, cmds, package_managers) {

    /* TODO: Translate to Rune

    Some bash script stuff here
    */

    Ok(())
}

becomes

fn setup_system_users(system, features, tasks, cmds, package_managers) {

    /* TODO: Translate to Rune

        Some bash script stuff here    *

    Ok(())
}
udoprog commented 3 weeks ago

Fixed in #790