To do this, two things in the code must be modified:
1. The Function that returns the language name given the extension
fn get_language_name<'a>(extension: &'a str) -> &'a str {
match extension {
"rs" => "Rust",
"c" => "C",
"cpp" | "cxx" | "c++" => "C++",
"py" => "Python",
"js" | "jsx" => "Javascript",
"ts" => "Typescript",
_ => {
println!("Uknown file extension: {}", extension);
"Uknown"
},
// TODO: Add more
}
}
2. Edit the constant KNWON_EXTENSION_BINDINGS
const KNOWN_EXTENSIONS_BINDINGS: &[(&str, &[&str])] = &[
("rs", &["//", "/*", "*/"]),
("c", &["//", "/*", "*/"]),
("cpp", &["//", "/*", "*/"]),("c++", &["//", "/*", "*/"]),("cxx", &["//", "/*", "*/"]),
("py", &["#", "\"\"\"", "\"\"\""]),
("js", &["//", "/*", "*/"]),("jsx", &["//", "/*", "*/"]),
("ts", &["//", "/*", "*/"]),
// TODO: Add more...
];
The upgrade of grouping this two things in just one is also allowed, and probably done in the future
To do this, two things in the code must be modified:
1. The Function that returns the language name given the extension
2. Edit the constant KNWON_EXTENSION_BINDINGS
The upgrade of grouping this two things in just one is also allowed, and probably done in the future