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:
kiyan42 2020-05-15 14:19:29 +02:00
parent 5a66c38b9f
commit 8be2dc64a2
7 changed files with 108 additions and 108 deletions

View file

@ -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