pub fn get_language_for_file(path: &Path) -> Option<LANG>
Expand description

Detects the language of a code using the extension of a file.

Examples

use std::path::Path;

use rust_code_analysis::get_language_for_file;

let path = Path::new("build.rs");
get_language_for_file(&path).unwrap();