Fix syntax map bug with combined injections inside of other injections

This commit is contained in:
Max Brunsfeld 2023-06-12 17:32:12 -07:00
parent ac1882b99b
commit 01bd5c30fc
2 changed files with 37 additions and 0 deletions

View file

@ -541,6 +541,15 @@ impl SyntaxSnapshot {
.to_ts_point();
}
if included_ranges.is_empty() {
included_ranges.push(tree_sitter::Range {
start_byte: 0,
end_byte: 0,
start_point: Default::default(),
end_point: Default::default(),
});
}
if let Some(SyntaxLayerContent::Parsed { tree: old_tree, .. }) =
old_layer.map(|layer| &layer.content)
{