mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
replace find_syntax_by_extension with find_syntax_by_token
This commit is contained in:
parent
3bbeab5713
commit
15a63a21c9
1 changed files with 3 additions and 3 deletions
|
|
@ -32,12 +32,12 @@ impl Syntax {
|
|||
source_tag: &TextTag,
|
||||
alt: Option<&String>,
|
||||
) -> Result<Vec<(TextTag, String)>, Error> {
|
||||
if let Some(name) = alt {
|
||||
if let Some(reference) = self.syntax_set.find_syntax_by_name(name) {
|
||||
if let Some(value) = alt {
|
||||
if let Some(reference) = self.syntax_set.find_syntax_by_name(value) {
|
||||
return self.syntect_buffer(source_code, source_tag, reference);
|
||||
}
|
||||
|
||||
if let Some(reference) = self.syntax_set.find_syntax_by_extension(name) {
|
||||
if let Some(reference) = self.syntax_set.find_syntax_by_token(value) {
|
||||
return self.syntect_buffer(source_code, source_tag, reference);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue