mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-18 21:17:08 +04:00
Show parser availability in --health [LANG] (#12228)
This commit is contained in:
parent
13e5a2ee5a
commit
9e4da4b950
@ -307,6 +307,8 @@ pub fn language(lang_str: String) -> std::io::Result<()> {
|
||||
.map(|formatter| formatter.command.to_string()),
|
||||
)?;
|
||||
|
||||
probe_parser(lang.grammar.as_ref().unwrap_or(&lang.language_id))?;
|
||||
|
||||
for ts_feat in TsFeature::all() {
|
||||
probe_treesitter_feature(&lang_str, *ts_feat)?
|
||||
}
|
||||
@ -314,6 +316,18 @@ pub fn language(lang_str: String) -> std::io::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn probe_parser(grammar_name: &str) -> std::io::Result<()> {
|
||||
let stdout = std::io::stdout();
|
||||
let mut stdout = stdout.lock();
|
||||
|
||||
write!(stdout, "Tree-sitter parser: ")?;
|
||||
|
||||
match helix_loader::grammar::get_language(grammar_name) {
|
||||
Ok(_) => writeln!(stdout, "{}", "✓".green()),
|
||||
Err(_) => writeln!(stdout, "{}", "None".yellow()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Display diagnostics about multiple LSPs and DAPs.
|
||||
fn probe_protocols<'a, I: Iterator<Item = &'a str> + 'a>(
|
||||
protocol_name: &str,
|
||||
|
Loading…
Reference in New Issue
Block a user