editor-core-lang 0.4.1

Language configuration helpers for editor-core (comments, etc.)
Documentation
1
2
3
4
5
6
7
8
9
10
11
use editor_core_lang::LanguageRegistry;
use std::path::Path;

fn main() {
    let reg = LanguageRegistry::default();

    let path = Path::new("src/main.rs");
    let lang = reg.language_for_path(path).expect("language match");

    println!("{}{}", path.display(), lang.display_name);
}