mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
add comments
This commit is contained in:
parent
3e2205015a
commit
8cb1e63222
@ -33,6 +33,9 @@ pub struct Syntax {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Syntax {
|
impl Syntax {
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
/// Create new `Self`
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
syntax_set: SyntaxSet::load_defaults_newlines(),
|
syntax_set: SyntaxSet::load_defaults_newlines(),
|
||||||
@ -40,6 +43,10 @@ impl Syntax {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
|
||||||
|
/// Apply `Syntect` highlight to new buffer returned,
|
||||||
|
/// according to given `alt` and `source_code` content
|
||||||
pub fn highlight(
|
pub fn highlight(
|
||||||
&self,
|
&self,
|
||||||
source_code: &str,
|
source_code: &str,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user