From 1e58c65276a6abfeda34bca7b544e50b11345f76 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 23 Aug 2022 08:21:47 -0500 Subject: [PATCH 1/4] Revert "fix: remove thead -> thread" This reverts commit 69f89505d812c6b118656b61322bd5ef340ad70b. --- crates/typos-dict/assets/words.csv | 1 + crates/typos-dict/src/dict_codegen.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/typos-dict/assets/words.csv b/crates/typos-dict/assets/words.csv index 912ecbd..26c2129 100644 --- a/crates/typos-dict/assets/words.csv +++ b/crates/typos-dict/assets/words.csv @@ -48342,6 +48342,7 @@ thast,that thatn,that,than thay,they thck,thick +thead,thread theard,thread thearding,threading theards,threads diff --git a/crates/typos-dict/src/dict_codegen.rs b/crates/typos-dict/src/dict_codegen.rs index a0bdf27..4f62c95 100644 --- a/crates/typos-dict/src/dict_codegen.rs +++ b/crates/typos-dict/src/dict_codegen.rs @@ -16217,6 +16217,7 @@ static WORD_THEA_NODE: dictgen::DictTrieNode<&'static [&'static str]> = dictgen: pub static WORD_THEA_CHILDREN: dictgen::DictTable<&'static [&'static str]> = dictgen::DictTable { keys: &[ + dictgen::InsensitiveStr::Ascii("d"), dictgen::InsensitiveStr::Ascii("rd"), dictgen::InsensitiveStr::Ascii("rding"), dictgen::InsensitiveStr::Ascii("rds"), @@ -16227,6 +16228,7 @@ pub static WORD_THEA_CHILDREN: dictgen::DictTable<&'static [&'static str]> = dic dictgen::InsensitiveStr::Ascii("ture"), ], values: &[ + &["thread"], &["thread"], &["threading"], &["threads"], @@ -16236,7 +16238,7 @@ pub static WORD_THEA_CHILDREN: dictgen::DictTable<&'static [&'static str]> = dic &["theatre"], &["theatre"], ], - range: 2..=5, + range: 1..=5, }; static WORD_THC_NODE: dictgen::DictTrieNode<&'static [&'static str]> = dictgen::DictTrieNode { From 58012099b13588adf7f74db368e476a309892e9b Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 23 Aug 2022 08:23:49 -0500 Subject: [PATCH 2/4] fix(config): Don't correct thead for HTML --- src/config.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/config.rs b/src/config.rs index 3094eea..f67779a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -179,6 +179,20 @@ impl TypeEngineConfig { ..Default::default() }, }); + patterns + .entry("html".into()) + .or_insert_with(|| GlobEngineConfig { + extend_glob: Vec::new(), + engine: EngineConfig { + dict: Some(DictConfig { + extend_identifiers: maplit::hashmap! { + "thead".into() => "thead".into(), + }, + ..Default::default() + }), + ..Default::default() + }, + }); patterns .entry("rust".into()) .or_insert_with(|| GlobEngineConfig { From 7d6047e7434a0872e6d7a4b06a750f5a3e1c679c Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 23 Aug 2022 08:25:12 -0500 Subject: [PATCH 3/4] fix(config): Don't correct windo in vim Fixes #539 --- src/config.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/config.rs b/src/config.rs index f67779a..016cca7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -193,6 +193,34 @@ impl TypeEngineConfig { ..Default::default() }, }); + patterns + .entry("vim".into()) + .or_insert_with(|| GlobEngineConfig { + extend_glob: Vec::new(), + engine: EngineConfig { + dict: Some(DictConfig { + extend_identifiers: maplit::hashmap! { + "windo".into() => "windo".into(), + }, + ..Default::default() + }), + ..Default::default() + }, + }); + patterns + .entry("vimscript".into()) + .or_insert_with(|| GlobEngineConfig { + extend_glob: Vec::new(), + engine: EngineConfig { + dict: Some(DictConfig { + extend_identifiers: maplit::hashmap! { + "windo".into() => "windo".into(), + }, + ..Default::default() + }), + ..Default::default() + }, + }); patterns .entry("rust".into()) .or_insert_with(|| GlobEngineConfig { From f072e45c9c36b6f50040309a208fac12e4730e3d Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 23 Aug 2022 08:32:27 -0500 Subject: [PATCH 4/4] fix(config): Narrow scope of flate check --- src/config.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 016cca7..328facf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -227,8 +227,10 @@ impl TypeEngineConfig { extend_glob: Vec::new(), engine: EngineConfig { dict: Some(DictConfig { + extend_identifiers: maplit::hashmap! { + "flate2".into() => "flate2".into(), + }, extend_words: maplit::hashmap! { - "flate".into() => "flate".into(), "ser".into() => "ser".into(), }, ..Default::default()