Skip to content

Commit fe4ca0b

Browse files
ArvinSKushwahakivikakk
authored andcommitted
Added documentation to public functions
1 parent 551d1cb commit fe4ca0b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/plugins/syntect.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,33 @@ pub struct SyntectAdapterBuilder<'a> {
119119
}
120120

121121
impl<'a> SyntectAdapterBuilder<'a> {
122+
/// Creates a new empty [`SyntectAdapterBuilder`]
122123
pub fn new() -> Self {
123124
Default::default()
124125
}
126+
127+
/// Sets the theme
125128
pub fn theme(mut self, s: &'a str) -> Self {
126129
self.theme.replace(s);
127130
self
128131
}
132+
133+
/// Sets the syntax set
129134
pub fn syntax_set(mut self, s: SyntaxSet) -> Self {
130135
self.syntax_set.replace(s);
131136
self
132137
}
138+
139+
/// Sets the theme set
133140
pub fn theme_set(mut self, s: ThemeSet) -> Self {
134141
self.theme_set.replace(s);
135142
self
136143
}
144+
145+
/// Builds the [`SyntectAdapter`]. Default values:
146+
/// - `theme`: `InspiredGitHub`
147+
/// - `syntax_set`: [`SyntaxSet::load_defaults_newlines()`]
148+
/// - `theme_set`: [`ThemeSet::load_defaults()`]
137149
pub fn build(self) -> SyntectAdapter<'a> {
138150
SyntectAdapter {
139151
theme: self.theme.unwrap_or("InspiredGitHub"),

0 commit comments

Comments
 (0)