aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-treesitter.lua
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-04-19 09:45:54 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2020-04-19 09:45:54 +0200
commit2526baf4cc5ea540188345c856adb162ce102674 (patch)
tree6bdf2bb238354161c484e92e575a30a7d77b7d09 /lua/nvim-treesitter.lua
parentfeat: add empty setup function (diff)
downloadnvim-treesitter-2526baf4cc5ea540188345c856adb162ce102674.tar
nvim-treesitter-2526baf4cc5ea540188345c856adb162ce102674.tar.gz
nvim-treesitter-2526baf4cc5ea540188345c856adb162ce102674.tar.bz2
nvim-treesitter-2526baf4cc5ea540188345c856adb162ce102674.tar.lz
nvim-treesitter-2526baf4cc5ea540188345c856adb162ce102674.tar.xz
nvim-treesitter-2526baf4cc5ea540188345c856adb162ce102674.tar.zst
nvim-treesitter-2526baf4cc5ea540188345c856adb162ce102674.zip
feat: add parsers module and better match iter
The `parsers` module manages parsers for us, for now only in a really basic way. iter_prepared_mathes iters on an enhanced versions of the matches, where captures are directly accessible via their names to allow things like : ((itentifier) @def.first (identifier) @def.last) To be handled like this in lua: match.def.first match.def.last Also adds a `set!` predicate to allow setting data within the prepared match (see queries/lua/locals.scm) for examples.
Diffstat (limited to 'lua/nvim-treesitter.lua')
-rw-r--r--lua/nvim-treesitter.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/lua/nvim-treesitter.lua b/lua/nvim-treesitter.lua
index cbed117d2..ab3edf071 100644
--- a/lua/nvim-treesitter.lua
+++ b/lua/nvim-treesitter.lua
@@ -1,10 +1,13 @@
local api = vim.api
+local parsers = require'nvim-treesitter.parsers'
local M = {}
-- This function sets up everythin needed for a given language
-- this is the main interface through the plugin
function M.setup(lang)
+ if parsers.has_parser(lang) then
+ end
end
return M