@@ -92,16 +92,18 @@ pub fn list_languages(config: &Config) -> Result<()> {
92 let lang_name = lang.name.clone();
92 let lang_name = lang.name.clone();
93 lang.file_extensions.retain(|extension| {
93 lang.file_extensions.retain(|extension| {
94 // The 'extension' variable is not certainly a real extension.
94 // The 'extension' variable is not certainly a real extension.
96 // Skip if 'extension' starts with '.', likely a hidden file like '.vimrc'
96 // Skip if 'extension' starts with '.', likely a hidden file like '.vimrc'
97− // Also skip if the 'extension' contains another real extension, likely
97+ // Also skip if the 'extension' contains another real extension, likely
98 // that is a full match file name like 'CMakeLists.txt' and 'Cargo.lock'
98 // that is a full match file name like 'CMakeLists.txt' and 'Cargo.lock'
99 if extension.starts_with('.') || Path::new(extension).extension().is_some() {
99 if extension.starts_with('.') || Path::new(extension).extension().is_some() {
102 let test_file = Path::new("test").with_extension(extension);
102 let test_file = Path::new("test").with_extension(extension);
103− let syntax = assets.syntax_for_file_name(test_file, &config.syntax_mapping).unwrap();
103+ match assets.syntax_for_file_name(test_file, &config.syntax_mapping) {
104− syntax.name == lang_name
104+ Some(syntax) => syntax.name == lang_name,