mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
feat(treesitter): add a query editor (#24703)
This commit is contained in:
committed by
GitHub
parent
ecd99e7dd7
commit
5d8ab32f38
@@ -472,8 +472,8 @@ end
|
||||
--- Open a window that displays a textual representation of the nodes in the language tree.
|
||||
---
|
||||
--- While in the window, press "a" to toggle display of anonymous nodes, "I" to toggle the
|
||||
--- display of the source language of each node, and press <Enter> to jump to the node under the
|
||||
--- cursor in the source buffer.
|
||||
--- display of the source language of each node, "o" to toggle the query previewer, and press
|
||||
--- <Enter> to jump to the node under the cursor in the source buffer.
|
||||
---
|
||||
--- Can also be shown with `:InspectTree`. *:InspectTree*
|
||||
---
|
||||
@@ -494,6 +494,13 @@ function M.inspect_tree(opts)
|
||||
require('vim.treesitter.dev').inspect_tree(opts)
|
||||
end
|
||||
|
||||
--- Open a window for live editing of a treesitter query.
|
||||
---
|
||||
--- Can also be shown with `:PreviewQuery`. *:PreviewQuery*
|
||||
function M.preview_query()
|
||||
require('vim.treesitter.dev').preview_query()
|
||||
end
|
||||
|
||||
--- Returns the fold level for {lnum} in the current buffer. Can be set directly to 'foldexpr':
|
||||
--- <pre>lua
|
||||
--- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
|
||||
Reference in New Issue
Block a user