pub struct BracketConfig {
pub line_comments: Vec<String>,
pub string_delims: Vec<u8>,
pub char_delim: Option<u8>,
}Expand description
Language config for comment/string-aware bracket matching: which delimiters
open a line comment / string / char literal, so brackets inside them are not
counted. All constructs are line-local — the state resets at every \n,
so block comments and multi-line strings are deliberately not handled (that
would make an edit’s cost scale with the document; see the module doc). The
Default (empty) config is no awareness — every bracket counts, the
original purely-structural behavior, at zero added cost.
Fields§
§line_comments: Vec<String>Line-comment markers (e.g. "//", "#"). From a marker to end of line is
a comment.
string_delims: Vec<u8>String delimiters (e.g. b'"'). A delimiter opens a string until the same
delimiter or end of line; \ escapes the next byte.
char_delim: Option<u8>Char-literal delimiter (e.g. b'\''), if any. Off by default: in some
languages ' is ambiguous (Rust lifetimes), so it is opt-in per language.
Implementations§
Trait Implementations§
Source§impl Clone for BracketConfig
impl Clone for BracketConfig
Source§fn clone(&self) -> BracketConfig
fn clone(&self) -> BracketConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BracketConfig
impl Debug for BracketConfig
Source§impl Default for BracketConfig
impl Default for BracketConfig
Source§fn default() -> BracketConfig
fn default() -> BracketConfig
impl Eq for BracketConfig
Source§impl PartialEq for BracketConfig
impl PartialEq for BracketConfig
impl StructuralPartialEq for BracketConfig
Auto Trait Implementations§
impl Freeze for BracketConfig
impl RefUnwindSafe for BracketConfig
impl Send for BracketConfig
impl Sync for BracketConfig
impl Unpin for BracketConfig
impl UnsafeUnpin for BracketConfig
impl UnwindSafe for BracketConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.