Add python outline and bracket queries

This commit is contained in:
Max Brunsfeld 2022-06-22 16:28:09 -07:00
parent 074caa09c2
commit c0dbd8f9b9
3 changed files with 13 additions and 1 deletions

View file

@ -1902,7 +1902,7 @@ impl BufferSnapshot {
}
while stack.last().map_or(false, |prev_range| {
!prev_range.contains(&item_range.start) || !prev_range.contains(&item_range.end)
prev_range.start > item_range.start || prev_range.end < item_range.end
}) {
stack.pop();
}

View file

@ -0,0 +1,3 @@
("(" @open ")" @close)
("[" @open "]" @close)
("{" @open "}" @close)

View file

@ -0,0 +1,9 @@
(class_definition
"class" @context
name: (identifier) @name
) @item
(function_definition
"async"? @context
"def" @context
name: (_) @name) @item