pub struct CommentConfig {
pub line: Option<String>,
pub block_start: Option<String>,
pub block_end: Option<String>,
}Expand description
Comment tokens/config for a given language.
The editor kernel can use this to implement comment toggling in a UI-agnostic way.
Fields§
§line: Option<String>Line comment token (e.g. //, #).
block_start: Option<String>Block comment start token (e.g. /*).
block_end: Option<String>Block comment end token (e.g. */).
Implementations§
Source§impl CommentConfig
impl CommentConfig
Sourcepub fn line(token: impl Into<String>) -> CommentConfig
pub fn line(token: impl Into<String>) -> CommentConfig
Create a config that supports only line comments.
Sourcepub fn block(start: impl Into<String>, end: impl Into<String>) -> CommentConfig
pub fn block(start: impl Into<String>, end: impl Into<String>) -> CommentConfig
Create a config that supports only block comments.
Sourcepub fn line_and_block(
line: impl Into<String>,
block_start: impl Into<String>,
block_end: impl Into<String>,
) -> CommentConfig
pub fn line_and_block( line: impl Into<String>, block_start: impl Into<String>, block_end: impl Into<String>, ) -> CommentConfig
Create a config that supports both line and block comments.
Trait Implementations§
Source§impl Clone for CommentConfig
impl Clone for CommentConfig
Source§fn clone(&self) -> CommentConfig
fn clone(&self) -> CommentConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommentConfig
impl Debug for CommentConfig
Source§impl Default for CommentConfig
impl Default for CommentConfig
Source§fn default() -> CommentConfig
fn default() -> CommentConfig
Returns the “default value” for a type. Read more
Source§impl PartialEq for CommentConfig
impl PartialEq for CommentConfig
impl Eq for CommentConfig
impl StructuralPartialEq for CommentConfig
Auto Trait Implementations§
impl Freeze for CommentConfig
impl RefUnwindSafe for CommentConfig
impl Send for CommentConfig
impl Sync for CommentConfig
impl Unpin for CommentConfig
impl UnsafeUnpin for CommentConfig
impl UnwindSafe for CommentConfig
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
Mutably borrows from an owned value. Read more