mirror of https://github.com/lapce/lapce.git
fix: lowercase filename when checking for language_id
This commit is contained in:
parent
c7f4b7d82f
commit
f951f6248d
|
@ -240,10 +240,14 @@ pub fn language_id_from_path(path: &Path) -> Option<&'static str> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Handle paths without extension
|
// Handle paths without extension
|
||||||
|
#[allow(clippy::match_single_binding)]
|
||||||
None => match path.file_name()?.to_str()? {
|
None => match path.file_name()?.to_str()? {
|
||||||
"dockerfile" => "dockerfile",
|
// case-insensitive matching
|
||||||
"makefile" | "gnumakefile" => "makefile",
|
filename => match filename.to_lowercase().as_str() {
|
||||||
_ => return None,
|
"dockerfile" => "dockerfile",
|
||||||
|
"makefile" | "gnumakefile" => "makefile",
|
||||||
|
_ => return None,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue