Skip to main content

lsp_language_for_path

Function lsp_language_for_path 

Source
pub fn lsp_language_for_path(path: &Path) -> Option<LspLanguage>
Expand description

Looks up the LSP language configuration for a file path.

Extracts the extension and delegates to lsp_language_for_extension.

ยงExamples

use std::path::Path;
use iced_code_editor::lsp_language_for_path;

let lang = lsp_language_for_path(Path::new("main.rs"));
assert!(lang.is_some());

let none = lsp_language_for_path(Path::new("noext"));
assert!(none.is_none());