mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-04 12:30:01 -04:00
Expose internal api.
- add `exposed_state` to expose 'current_node' and 'cursor_pos' for a current buffer to the user. - add `get_buf_state` and `get_node_api` for users. - add documentation about api functions. - remove `node_movement` module which should be done in user side.
This commit is contained in:
parent
5a66c38b9f
commit
8be2dc64a2
7 changed files with 108 additions and 108 deletions
|
|
@ -5,6 +5,7 @@ local utils = require'nvim-treesitter.utils'
|
|||
local info = require'nvim-treesitter.info'
|
||||
local configs = require'nvim-treesitter.configs'
|
||||
local state = require'nvim-treesitter.state'
|
||||
local ts_utils = require'nvim-treesitter.ts_utils'
|
||||
|
||||
local M = {}
|
||||
|
||||
|
|
@ -55,4 +56,13 @@ function M.statusline(indicator_size)
|
|||
end
|
||||
end
|
||||
|
||||
function M.get_buf_state()
|
||||
local bufnr = api.nvim_get_current_buf()
|
||||
return state.exposed_state(bufnr)
|
||||
end
|
||||
|
||||
function M.get_node_api()
|
||||
return ts_utils
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue