Skip to main content

ParserConfig

Trait ParserConfig 

Source
pub trait ParserConfig {
    // Provided methods
    fn enable_glob(&self) -> bool { ... }
    fn enable_extension(&self) -> bool { ... }
    fn enable_exclude(&self) -> bool { ... }
    fn enable_path_segments(&self) -> bool { ... }
    fn enable_type_filter(&self) -> bool { ... }
    fn enable_git_status(&self) -> bool { ... }
    fn enable_location(&self) -> bool { ... }
    fn is_glob_pattern(&self, token: &str) -> bool { ... }
    fn parse_custom<'a>(&self, _input: &'a str) -> Option<Constraint<'a>> { ... }
}
Expand description

Parser configuration trait - allows different picker types to customize parsing

Provided Methods§

Source

fn enable_glob(&self) -> bool

Source

fn enable_extension(&self) -> bool

Should parse extension shortcuts (e.g., *.rs)

Source

fn enable_exclude(&self) -> bool

Should parse exclusion patterns (e.g., !test)

Source

fn enable_path_segments(&self) -> bool

Should parse path segments (e.g., /src/)

Source

fn enable_type_filter(&self) -> bool

Should parse type constraints (e.g., type:rust)

Source

fn enable_git_status(&self) -> bool

Should parse git status (e.g., status:modified)

Source

fn enable_location(&self) -> bool

Should parse location suffixes (e.g., file:12, file:12:4) Disabled for grep modes where colon-number patterns like localhost:8080 are search text, not file locations.

Source

fn is_glob_pattern(&self, token: &str) -> bool

Determine whether a token should be treated as a glob constraint.

The default implementation delegates to zlob::has_wildcards with RECOMMENDED flags, which recognises *, ?, [, {…} etc.

Override this in configs where some wildcard characters are common in search text (e.g. grep mode where ? and [ appear in code).

Source

fn parse_custom<'a>(&self, _input: &'a str) -> Option<Constraint<'a>>

Custom constraint parsers for picker-specific needs

Implementors§