summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/parsers.lua
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-11-03 21:08:36 +0100
committerThomas Vigouroux <tomvig38@gmail.com>2020-11-03 21:16:51 +0100
commit6eca8d2f3860e7d76b0b524877c13206c2900b01 (patch)
tree2175e9c40c4343ceab56c12516d914bd4c2e421e /lua/nvim-treesitter/parsers.lua
parentf999dc41131c3c69f2411af13597932c042e8e5a (diff)
parser: only use parse to get a tree
This will avoid using internal data.
Diffstat (limited to 'lua/nvim-treesitter/parsers.lua')
-rw-r--r--lua/nvim-treesitter/parsers.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 293186c5..6384bf20 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -397,7 +397,7 @@ end
function M.get_tree_root(bufnr)
local bufnr = bufnr or api.nvim_get_current_buf()
- return M.get_parser(bufnr).tree:root()
+ return M.get_parser(bufnr):parse():root()
end
-- get language of given buffer