mirror of https://github.com/lapce/lapce.git
Merge pull request #1112 from panekj/fix/lowercase-filename
fix: lowercase filename when checking for language_id
This commit is contained in:
commit
9bff49dd68
|
@ -240,11 +240,15 @@ 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()? {
|
||||||
|
// case-insensitive matching
|
||||||
|
filename => match filename.to_lowercase().as_str() {
|
||||||
"dockerfile" => "dockerfile",
|
"dockerfile" => "dockerfile",
|
||||||
"makefile" | "gnumakefile" => "makefile",
|
"makefile" | "gnumakefile" => "makefile",
|
||||||
_ => return None,
|
_ => return None,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue