Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
Added words and removed `dbg!` stmts
Elijah Pottere6b2019d32b2
diff --git a/dictionary.dict b/dictionary.dictindex b41fd203e..f2bded0b3 100644--- a/dictionary.dict+++ b/dictionary.dict@@ -10725,6 +10725,14 @@ Zephyrhills/MZephyrus/MZest/MZeus/M+Maia/M+Semele/M+Katniss/M+Everdeen/M+Leto/M+Ouranos/M+Hecatoncheires/M+Theia/MZhdanovZhejiang/MZhengzhou/Mdiff --git a/harper-core/src/parsing/lexer.rs b/harper-core/src/parsing/lexer.rsindex d2b14ba64..e42509cca 100644--- a/harper-core/src/parsing/lexer.rs+++ b/harper-core/src/parsing/lexer.rs@@ -36,10 +36,6 @@ pub fn lex_to_end_md(source: &[char]) -> Vec<Token> {.iter_mut().for_each(|token| token.span.offset(traversed_chars));- for token in new_tokens.iter() {- dbg!(token.span);- }-tokens.append(&mut new_tokens);}}diff --git a/harper-core/src/spell/hunspell/attributes.rs b/harper-core/src/spell/hunspell/attributes.rsindex 3aec1d787..c4c7ca271 100644--- a/harper-core/src/spell/hunspell/attributes.rs+++ b/harper-core/src/spell/hunspell/attributes.rs@@ -1,5 +1,5 @@use itertools::Itertools;-use std::{mem::replace, usize};+use std::usize;use ahash::HashMap;@@ -89,9 +89,7 @@ impl AttributeList {expansion.replacements.push(replacement)} else {let cross_product = parser.parse_bool_arg()?;- dbg!(cross_product);let count = parser.parse_usize_arg()?;- dbg!(count);self.affixes.insert(flag,diff --git a/harper-core/src/spell/hunspell/mod.rs b/harper-core/src/spell/hunspell/mod.rsindex 43b500674..139ff7adb 100644--- a/harper-core/src/spell/hunspell/mod.rs+++ b/harper-core/src/spell/hunspell/mod.rs@@ -31,8 +31,6 @@ mod tests {let words = parse_word_list(TEST_WORD_LIST).unwrap();let attributes = AttributeList::parse(ATTR_LIST).unwrap();- dbg!(&attributes);-let expanded = attributes.expand_marked_words(words).unwrap();let expanded: Vec<String> = expanded.into_iter()@@ -61,8 +59,6 @@ mod tests {let words = parse_default_word_list().unwrap();let attributes = parse_default_attribute_list().unwrap();- dbg!(&attributes);-attributes.expand_marked_words(words).unwrap()}diff --git a/harper-ls/src/backend.rs b/harper-ls/src/backend.rsindex 25a2209c6..651a7963a 100644--- a/harper-ls/src/backend.rs+++ b/harper-ls/src/backend.rs@@ -1,3 +1,4 @@+use tokio::time::Instant;use tower_lsp::{jsonrpc::Result,lsp_types::{@@ -22,6 +23,7 @@ impl Backend {}async fn publish_diagnostics(&self, url: &Url) {+ let start_time = Instant::now();let diagnostics = generate_diagnostics(url).unwrap();let result = PublishDiagnosticsParams {@@ -33,6 +35,20 @@ impl Backend {self.client.send_notification::<PublishDiagnostics>(result).await;++ let end_time = Instant::now();++ let duration = end_time - start_time;++ self.client+ .log_message(+ MessageType::LOG,+ format!(+ "Took {} ms to generate and publish diagnostics.",+ duration.as_millis()+ ),+ )+ .await;}}diff --git a/harper-ls/src/diagnostics.rs b/harper-ls/src/diagnostics.rsindex d6f7c0b53..a57f309da 100644--- a/harper-ls/src/diagnostics.rs+++ b/harper-ls/src/diagnostics.rs@@ -1,3 +1,4 @@+use cached::proc_macro::cached;use harper_core::{all_linters, Dictionary, Document, Lint, Span, Suggestion};use std::collections::HashMap;use std::fs::read;@@ -75,7 +76,7 @@ fn open_url(url: &Url) -> Result<String> {Ok(String::from_utf8(file).unwrap())}-#[cached::proc_macro::cached]+#[cached]fn lint_string(text: String) -> Vec<Lint> {let document = Document::new(&text, true);let dictionary = Dictionary::new();