mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 17:41:48 +00:00
feat(treesitter): introduce child_with_descendant()
This commit also marks `child_containing_descendant()` as deprecated (per upstream's documentation), and uses `child_with_descendant()` in its place. Minimum required tree-sitter version will now be `0.24`.
This commit is contained in:
committed by
Christian Clason
parent
c4762b3097
commit
267c7525f7
@@ -405,6 +405,20 @@ void ui_refresh(void)
|
||||
{ 'literal', 'number_literal', { 0, 8, 0, 11 }, '123' },
|
||||
{ 'literal', 'number_literal', { 2, 21, 2, 24 }, '125' },
|
||||
}, result)
|
||||
|
||||
result = exec_lua(
|
||||
get_query_result,
|
||||
[[((number_literal) @literal (#has-ancestor? @literal "enumerator"))]]
|
||||
)
|
||||
eq({
|
||||
{ 'literal', 'number_literal', { 1, 13, 1, 16 }, '124' },
|
||||
}, result)
|
||||
|
||||
result = exec_lua(
|
||||
get_query_result,
|
||||
[[((number_literal) @literal (#has-ancestor? @literal "number_literal"))]]
|
||||
)
|
||||
eq({}, result)
|
||||
end)
|
||||
|
||||
it('allows loading query with escaped quotes and capture them `#{lua,vim}-match`?', function()
|
||||
|
||||
Reference in New Issue
Block a user