Skip to content

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

Web UI now only shows fixable lints

Elijah Potter53edfb494e46
diff --git a/harper-core/src/parsing/lexer.rs b/harper-core/src/parsing/lexer.rs
index e42509cca..99002cdb4 100644
--- a/harper-core/src/parsing/lexer.rs
+++ b/harper-core/src/parsing/lexer.rs
@@ -224,8 +224,7 @@ lex_punctuation! {
"]" => CloseSquare,
"(" => OpenRound,
")" => CloseRound,
- "#" => Hash,
- "'" => Apostrophe
+ "#" => Hash
}
fn lex_quote(source: &[char]) -> Option<FoundToken> {
diff --git a/web/src/lib/analysis.ts b/web/src/lib/analysis.ts
index af878873b..d804dae1f 100644
--- a/web/src/lib/analysis.ts
+++ b/web/src/lib/analysis.ts
@@ -1,4 +1,4 @@
-const defaultUseWasm = true;
+const defaultUseWasm = false;
export interface ParseResponse {
tokens: Token[];
@@ -96,7 +96,9 @@ export async function lintText(text: string, useWasm = defaultUseWasm): Promise<
});
const res: LintResponse = await req.json();
- return res.lints;
+
+ // We only want to show fixable errors.
+ return res.lints.filter((lint) => lint.suggestions.length > 0);
}
}