Use SyntaxMap in Buffer

This commit is contained in:
Max Brunsfeld 2022-08-23 17:09:13 -07:00
parent 9113c94371
commit ced45cbb0a
6 changed files with 830 additions and 532 deletions

View file

@ -1407,7 +1407,9 @@ fn json_lang() -> Language {
fn get_tree_sexp(buffer: &ModelHandle<Buffer>, cx: &gpui::TestAppContext) -> String {
buffer.read_with(cx, |buffer, _| {
buffer.syntax_tree().unwrap().root_node().to_sexp()
let syntax_map = buffer.syntax_map();
let layers = syntax_map.layers(buffer.as_text_snapshot());
layers[0].2.to_sexp()
})
}