diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-05-20 10:04:49 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-05-20 10:04:49 +0200 |
| commit | c9b72aaa84bdd5f67283889a907c8416a853b73c (patch) | |
| tree | c8dcefcc7efab17b29c7ce4716ed5c73230288f2 /src/source.rs | |
| parent | fcce3df093d0141c677608a74c25ea0d413c5050 (diff) | |
More highlighting API
Diffstat (limited to 'src/source.rs')
| -rw-r--r-- | src/source.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/source.rs b/src/source.rs index deeaef4b..7973a2ee 100644 --- a/src/source.rs +++ b/src/source.rs @@ -12,7 +12,7 @@ use crate::diag::TypResult; use crate::loading::{FileHash, Loader}; use crate::parse::{is_newline, parse, reparse}; use crate::syntax::ast::Markup; -use crate::syntax::{self, Category, GreenNode, RedNode, Span}; +use crate::syntax::{GreenNode, RedNode, Span}; use crate::util::{PathExt, StrExt}; #[cfg(feature = "codespan-reporting")] @@ -269,14 +269,6 @@ impl SourceFile { reparse(&mut self.root, &self.src, replace, with.len()) } - /// Provide highlighting categories for the given range of the source file. - pub fn highlight<F>(&self, range: Range<usize>, mut f: F) - where - F: FnMut(Range<usize>, Category), - { - syntax::highlight(self.red().as_ref(), range, &mut f) - } - /// Get the length of the file in bytes. pub fn len_bytes(&self) -> usize { self.src.len() |
