Merge pull request #912 from epage/ts

fix(config): Don't treat ts as typoscript
This commit is contained in:
Ed Page 2024-01-19 10:38:44 -06:00 committed by GitHub
commit 309146717e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 17 deletions

View file

@ -39,7 +39,6 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
"*.p7b", "*.p7b",
"*.p7c", "*.p7c",
"*.p7s", "*.p7s",
"*.pem",
// Keystore Files: // Keystore Files:
"*.key", "*.key",
"*.keystore", "*.keystore",
@ -61,7 +60,6 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
]), ]),
("creole", &["*.creole"]), ("creole", &["*.creole"]),
("crystal", &["Projectfile", "*.cr", "*.ecr", "shard.yml"]), ("crystal", &["Projectfile", "*.cr", "*.ecr", "shard.yml"]),
("cs", &["*.cs"]),
("csharp", &["*.cs"]), ("csharp", &["*.cs"]),
("cshtml", &["*.cshtml"]), ("cshtml", &["*.cshtml"]),
("css", &["*.css", "*.scss"]), ("css", &["*.css", "*.scss"]),
@ -99,7 +97,6 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
("gzip", &["*.gz", "*.tgz"]), ("gzip", &["*.gz", "*.tgz"]),
("h", &["*.h", "*.hpp"]), ("h", &["*.h", "*.hpp"]),
("haml", &["*.haml"]), ("haml", &["*.haml"]),
("haskell", &["*.hs", "*.lhs", "*.cpphs", "*.c2hs", "*.hsc"]),
("hbs", &["*.hbs"]), ("hbs", &["*.hbs"]),
("hs", &["*.hs", "*.lhs"]), ("hs", &["*.hs", "*.lhs"]),
("html", &["*.htm", "*.html", "*.ejs"]), ("html", &["*.htm", "*.html", "*.ejs"]),
@ -159,7 +156,6 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
]), ]),
("mako", &["*.mako", "*.mao"]), ("mako", &["*.mako", "*.mao"]),
("man", &["*.[0-9lnpx]", "*.[0-9][cEFMmpSx]"]), ("man", &["*.[0-9lnpx]", "*.[0-9][cEFMmpSx]"]),
("markdown", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]),
("matlab", &["*.m"]), ("matlab", &["*.m"]),
("md", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]), ("md", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]),
("meson", &["meson.build", "meson_options.txt"]), ("meson", &["meson.build", "meson_options.txt"]),
@ -265,15 +261,12 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
("ts", &["*.ts", "*.tsx"]), ("ts", &["*.ts", "*.tsx"]),
("twig", &["*.twig"]), ("twig", &["*.twig"]),
("txt", &["*.txt"]), ("txt", &["*.txt"]),
("typoscript", &["*.typoscript", "*.ts"]), ("typoscript", &["*.typoscript"]),
("vala", &["*.vala"]), ("vala", &["*.vala"]),
("vb", &["*.vb"]), ("vb", &["*.vb"]),
("vcl", &["*.vcl"]), ("vcl", &["*.vcl"]),
("verilog", &["*.v", "*.vh", "*.sv", "*.svh"]), ("verilog", &["*.v", "*.vh", "*.sv", "*.svh"]),
("vhdl", &["*.vhd", "*.vhdl"]), ("vhdl", &["*.vhd", "*.vhdl"]),
("vim", &[
"*.vim", ".vimrc", ".gvimrc", "vimrc", "gvimrc", "_vimrc", "_gvimrc",
]),
("vimscript", &[ ("vimscript", &[
"*.vim", ".vimrc", ".gvimrc", "vimrc", "gvimrc", "_vimrc", "_gvimrc", "*.vim", ".vimrc", ".gvimrc", "vimrc", "gvimrc", "_vimrc", "_gvimrc",
]), ]),
@ -299,3 +292,20 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
]), ]),
("zstd", &["*.zst", "*.zstd"]), ("zstd", &["*.zst", "*.zstd"]),
]; ];
// See `cargo test --lib -- --nocapture default_types::check_duplicates`
#[test]
fn check_duplicates() {
let mut reverse = std::collections::BTreeMap::new();
for (name, exts) in DEFAULT_TYPES {
for ext in *exts {
reverse.entry(ext).or_insert(Vec::new()).push(name);
}
}
for (ext, names) in reverse {
if 1 < names.len() {
println!("{ext} is under multiple names: {names:?}");
}
}
}

View file

@ -67,15 +67,6 @@ pub const TYPE_SPECIFIC_DICTS: &[(&str, StaticDictConfig)] = &[
ignore_words: &[], ignore_words: &[],
}, },
), ),
(
"vim",
StaticDictConfig {
ignore_idents: &[
"windo", // https://vimdoc.sourceforge.net/htmldoc/windows.html#:windo
],
ignore_words: &[],
},
),
( (
"vimscript", "vimscript",
StaticDictConfig { StaticDictConfig {