StyleSuppression.h header
#include <ew/app/StyleSuppression.h>
Namespace ew::app
StyleSuppression class
class ew::app::StyleSuppression
A persistent set of style-issue suppressions the writer has chosen to ignore. Two granularities: a whole CATEGORY (e.g. "stop flagging passive voice") and a specific flagged PHRASE within a category (e.g. "I use 'very' on purpose, don't flag it"). It is the single filter that both the Style panel and the editor's inline style underline consult, so an ignored issue disappears from both at once. Phrase matching is case-insensitive and whitespace-trimmed. Serializes to a stable text form so a writer's choices persist across sessions.
Members
void ew::app::StyleSuppression::ignoreCategory(StyleCategory category)
Ignores every issue of category.
void ew::app::StyleSuppression::allowCategory(StyleCategory category)
Stops ignoring category, so its issues are flagged again.
bool ew::app::StyleSuppression::categoryIgnored(StyleCategory category) const
True when the whole category is ignored.
void ew::app::StyleSuppression::ignorePhrase(StyleCategory category, const QString &phrase)
Ignores the specific flagged phrase within category (trimmed, folded to lower case). An empty phrase is ignored (nothing to suppress).
void ew::app::StyleSuppression::allowPhrase(StyleCategory category, const QString &phrase)
Stops ignoring phrase within category.
bool ew::app::StyleSuppression::suppresses(StyleCategory category, QStringView text) const
The single filter, given the flagged text directly: true when category is ignored wholesale, or text is an ignored phrase within it. Used by the inline highlighter, which has the underlined span's text.
bool ew::app::StyleSuppression::suppresses(const StyleDiagnostic &diagnostic, QStringView sourceText) const
The single filter for a diagnostic whose flagged span lives in sourceText (the text the diagnostic's offset/length index into): extracts the span and applies suppresses() above.
bool ew::app::StyleSuppression::empty() const
True when nothing is suppressed.
void ew::app::StyleSuppression::clear()
Forgets every suppression.
QString ew::app::StyleSuppression::serialize() const
Serializes to a stable, human-diffable text form (one entry per line): a whole-category entry is the category token; a phrase entry is "token<TAB>phrase". deserialize() is its inverse.
bool ew::app::StyleSuppression::operator==(const StyleSuppression &) const =default
Two suppression sets are equal when they ignore exactly the same categories and phrases.
static StyleSuppression ew::app::StyleSuppression::deserialize(const QString &text)
Parses the text produced by serialize(); unrecognized or malformed lines are skipped.