add find_syntax_by_path method in order

This commit is contained in:
yggverse 2024-12-03 04:16:37 +02:00
parent 15a63a21c9
commit fe9c859f7f

View File

@ -40,6 +40,10 @@ impl Syntax {
if let Some(reference) = self.syntax_set.find_syntax_by_token(value) { if let Some(reference) = self.syntax_set.find_syntax_by_token(value) {
return self.syntect_buffer(source_code, source_tag, reference); return self.syntect_buffer(source_code, source_tag, reference);
} }
if let Some(reference) = self.syntax_set.find_syntax_by_path(value) {
return self.syntect_buffer(source_code, source_tag, reference);
}
} }
if let Some(reference) = self.syntax_set.find_syntax_by_first_line(source_code) { if let Some(reference) = self.syntax_set.find_syntax_by_first_line(source_code) {