Skip to main content

ConfigSettings

Struct ConfigSettings 

Source
pub struct ConfigSettings {
    pub dictionaries: Vec<String>,
    pub words: Vec<String>,
    pub flag_words: Vec<String>,
    pub include_paths: Vec<String>,
    pub ignore_paths: Vec<String>,
    pub ignore_patterns: Vec<String>,
    pub use_global: bool,
    pub min_word_length: usize,
    pub include_tags: Vec<String>,
    pub exclude_tags: Vec<String>,
}

Fields§

§dictionaries: Vec<String>

List of dictionaries to use for spell checking

§words: Vec<String>

Custom allowlist of words

§flag_words: Vec<String>

Words that should always be flagged

§include_paths: Vec<String>

Glob patterns for paths to include

§ignore_paths: Vec<String>

Glob patterns for paths to ignore

§ignore_patterns: Vec<String>

Regex patterns for text to ignore

§use_global: bool

Whether to use global configuration

§min_word_length: usize

Minimum word length to check (words shorter than this are ignored)

§include_tags: Vec<String>

Tag prefixes to include (if non-empty, only matching tags are checked)

§exclude_tags: Vec<String>

Tag prefixes to exclude (takes precedence over include_tags)

Implementations§

Source§

impl ConfigSettings

Source

pub fn merge(&mut self, other: ConfigSettings)

Merge another config settings into this one, sorting and deduplicating all collections

Source

pub fn sort_and_dedup(&mut self)

Sort and deduplicate all collections in the config

Source§

impl ConfigSettings

Source

pub fn should_check_tag(&self, tag: &str) -> bool

Determine whether a capture tag should be spell-checked based on include_tags and exclude_tags. exclude_tags takes precedence.

Source

pub fn insert_word(&mut self, word: &str) -> bool

Insert a word into the allowlist, returning true when it was newly added.

Source

pub fn insert_ignore(&mut self, file: &str) -> bool

Insert a path into the ignore list, returning true when it was newly added.

Source

pub fn insert_include(&mut self, file: &str) -> bool

Insert a path into the include list, returning true when it was newly added.

Source

pub fn dictionary_ids(&self) -> Vec<String>

Resolve configured dictionary IDs, providing a default when none are set.

Source

pub fn should_include_path(&self, path: &Path) -> bool

Determine whether a path should be included based on the configured glob patterns.

Source

pub fn should_ignore_path(&self, path: &Path) -> bool

Determine whether a path should be ignored based on the configured glob patterns.

Source

pub fn is_allowed_word(&self, word: &str) -> bool

Check if a word is explicitly allowed.

Source

pub fn should_flag_word(&self, word: &str) -> bool

Check if a word should be flagged.

Source

pub fn min_word_length(&self) -> usize

Retrieve the configured minimum word length.

Trait Implementations§

Source§

impl Clone for ConfigSettings

Source§

fn clone(&self) -> ConfigSettings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConfigSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ConfigSettings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ConfigSettings

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ConfigSettings

Source§

fn eq(&self, other: &ConfigSettings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ConfigSettings

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ConfigSettings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,