Finish generalizing ToggleComments to support block comments

This commit is contained in:
Max Brunsfeld 2022-10-05 12:25:32 -07:00
parent d9fb8c90d8
commit aa86806408
3 changed files with 126 additions and 24 deletions

View file

@ -1840,6 +1840,7 @@ impl BufferSnapshot {
let offset = position.to_offset(self);
self.syntax
.layers_for_range(offset..offset, &self.text)
.filter(|l| l.node.end_byte() > offset)
.last()
.map(|info| info.language)
.or(self.language.as_ref())