oo_ide/schema/format/
mod.rs1pub mod toml;
9pub mod yaml;
10pub mod json;
11
12use std::path::Path;
13
14use crate::editor::position::Position;
15use crate::schema::context::CursorContext;
16
17pub fn detect_cursor_context(
22 lines: &[String],
23 trigger: &Position,
24 path: Option<&Path>,
25) -> Option<CursorContext> {
26 let ext = path?.extension()?.to_str()?;
27 match ext {
28 "toml" => toml::detect_context(lines, trigger),
29 "yaml" | "yml" => yaml::detect_context(lines, trigger),
30 "json" => json::detect_context(lines, trigger),
31 _ => None,
32 }
33}