File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -119,21 +119,33 @@ pub struct SyntectAdapterBuilder<'a> {
119119}
120120
121121impl < ' 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" ) ,
You can’t perform that action at this time.
0 commit comments