Improve the look of the syntax tree view UI

This commit is contained in:
Max Brunsfeld 2023-06-12 12:18:01 -07:00
parent e969e3b028
commit 56b749788f
8 changed files with 382 additions and 67 deletions

View file

@ -2117,6 +2117,10 @@ impl BufferSnapshot {
}
}
pub fn syntax_layers(&self) -> impl Iterator<Item = SyntaxLayerInfo> + '_ {
self.syntax.layers_for_range(0..self.len(), &self.text)
}
pub fn syntax_layer_at<D: ToOffset>(&self, position: D) -> Option<SyntaxLayerInfo> {
let offset = position.to_offset(self);
self.syntax