@@ -172,7 +172,7 @@ thread_local! {
172pub struct Syntax {
172pub struct Syntax {
173 config: Arc<HighlightConfiguration>,
173 config: Arc<HighlightConfiguration>,
175− pub(crate) root_layer: LanguageLayer,
175+ root_layer: LanguageLayer,
178fn byte_range_to_str(range: std::ops::Range<usize>, source: RopeSlice) -> Cow<str> {
178fn byte_range_to_str(range: std::ops::Range<usize>, source: RopeSlice) -> Cow<str> {
@@ -251,7 +251,7 @@ impl Syntax {
252 // fn parse(language, old_tree, ranges)
252 // fn parse(language, old_tree, ranges)
254− fn tree(&self) -> &Tree {
254+ pub fn tree(&self) -> &Tree {
255 self.root_layer.tree()
255 self.root_layer.tree()
@@ -363,7 +363,7 @@ impl LanguageLayer {
363 // Self { tree: None }
363 // Self { tree: None }
366− fn tree(&self) -> &Tree {
366+ pub fn tree(&self) -> &Tree {
367 // TODO: no unwrap
367 // TODO: no unwrap
368 self.tree.as_ref().unwrap()
368 self.tree.as_ref().unwrap()
@@ -1566,7 +1566,7 @@ fn test_parser() {
1568 let syntax = Syntax::new(&source, Arc::new(config));
1568 let syntax = Syntax::new(&source, Arc::new(config));
1569− let tree = syntax.root_layer.tree.unwrap();
1569+ let tree = syntax.tree();
1570 let root = tree.root_node();
1570 let root = tree.root_node();
1571 assert_eq!(root.kind(), "source_file");
1571 assert_eq!(root.kind(), "source_file");