Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

chore(ls): remove dead code

Elijah Potter42476b69e320
diff --git a/harper-ls/src/backend.rs b/harper-ls/src/backend.rs
index 45fc839ab..d493d2ff9 100644
--- a/harper-ls/src/backend.rs
+++ b/harper-ls/src/backend.rs
@@ -1,5 +1,5 @@
use std::collections::HashMap;
-use std::fs::{File, OpenOptions};
+use std::fs::OpenOptions;
use std::io::{BufWriter, Write};
use std::path::{Component, PathBuf};
use std::sync::Arc;
diff --git a/harper-ls/src/diagnostics.rs b/harper-ls/src/diagnostics.rs
index 4256a01d8..13a8453aa 100644
--- a/harper-ls/src/diagnostics.rs
+++ b/harper-ls/src/diagnostics.rs
@@ -1,5 +1,4 @@
use std::collections::HashMap;
-use std::str::FromStr;
use harper_core::linting::{Lint, Suggestion};
use harper_core::CharStringExt;
diff --git a/harper-ls/src/stats/lint_summary.rs b/harper-ls/src/stats/lint_summary.rs
deleted file mode 100644
index 2df928fd7..000000000
--- a/harper-ls/src/stats/lint_summary.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-use std::collections::HashMap;
-
-use harper_core::linting::LintKind;
-
-pub struct LintSummary {
- counts: HashMap<LintKind, usize>,
-}
-
-impl LintSummary {
- pub fn new() -> Self {
- Self {
- counts: HashMap::new(),
- }
- }
-
- /// Increment the count for a particular lint kind.
- pub fn inc(&mut self, kind: LintKind) {
- self.counts
- .entry(kind)
- .and_modify(|counter| *counter += 1)
- .or_insert(1);
- }
-
- /// Get the count for a particular lint kind.
- pub fn get(&self, kind: LintKind) -> usize {
- self.counts.get(&kind).copied().unwrap_or(0)
- }
-}
diff --git a/harper-ls/src/stats/mod.rs b/harper-ls/src/stats/mod.rs
index 900dc59b2..88a5b0dff 100644
--- a/harper-ls/src/stats/mod.rs
+++ b/harper-ls/src/stats/mod.rs
@@ -1,10 +1,8 @@
mod lint_record;
-mod lint_summary;
use std::io::Write;
pub use lint_record::LintRecord;
-pub use lint_summary::LintSummary;
use tokio::io;
pub struct Stats {
@@ -19,17 +17,6 @@ impl Stats {
}
}
- /// Count the number of each kind of lint applied.
- pub fn summarize_lints_applied(&self) -> LintSummary {
- let mut summary = LintSummary::new();
-
- for lint in &self.lints_applied {
- summary.inc(lint.kind);
- }
-
- summary
- }
-
pub fn lint_applied(&mut self, record: LintRecord) {
self.lints_applied.push(record);
}