@@ -172,7 +172,7 @@ thread_local! {
172172pub struct Syntax {
173173 config: Arc<HighlightConfiguration>,
174174
175− pub(crate) root_layer: LanguageLayer,
175+ root_layer: LanguageLayer,
176176}
177177
178178fn byte_range_to_str(range: std::ops::Range<usize>, source: RopeSlice) -> Cow<str> {
@@ -251,7 +251,7 @@ impl Syntax {
251251 //
252252 // fn parse(language, old_tree, ranges)
253253 //
254− fn tree(&self) -> &Tree {
254+ pub fn tree(&self) -> &Tree {
255255 self.root_layer.tree()
256256 }
257257 //
@@ -363,7 +363,7 @@ impl LanguageLayer {
363363 // Self { tree: None }
364364 // }
365365
366− fn tree(&self) -> &Tree {
366+ pub fn tree(&self) -> &Tree {
367367 // TODO: no unwrap
368368 self.tree.as_ref().unwrap()
369369 }
@@ -1566,7 +1566,7 @@ fn test_parser() {
15661566 ",
15671567 );
15681568 let syntax = Syntax::new(&source, Arc::new(config));
1569− let tree = syntax.root_layer.tree.unwrap();
1569+ let tree = syntax.tree();
15701570 let root = tree.root_node();
15711571 assert_eq!(root.kind(), "source_file");
15721572