Skip to main content

normalize_languages/
sshconfig.rs

1//! SSH config file support.
2
3use crate::{Language, LanguageSymbols};
4
5/// SSH config language support.
6pub struct SshConfig;
7
8impl Language for SshConfig {
9    fn name(&self) -> &'static str {
10        "SSH Config"
11    }
12    fn extensions(&self) -> &'static [&'static str] {
13        &[]
14    } // Matched by filename
15    fn grammar_name(&self) -> &'static str {
16        "ssh-config"
17    }
18
19    fn as_symbols(&self) -> Option<&dyn LanguageSymbols> {
20        Some(self)
21    }
22}
23
24impl LanguageSymbols for SshConfig {}
25
26#[cfg(test)]
27mod tests {
28    use super::*;
29    use crate::validate_unused_kinds_audit;
30
31    #[test]
32    fn unused_node_kinds_audit() {
33        #[rustfmt::skip]
34        let documented_unused: &[&str] = &[
35            "host_declaration", "match_declaration",
36        ];
37        validate_unused_kinds_audit(&SshConfig, documented_unused)
38            .expect("SSH Config unused node kinds audit failed");
39    }
40}