summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/info.lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2020-07-31 20:27:06 +0200
committerStephan Seitz <stephan.lauf@yahoo.de>2020-08-02 22:58:08 +0200
commita872762d8240d9f81402b69fa7f20d1c1bbda919 (patch)
tree4276823cdbc75cc7d80957e9013ba29b1737d114 /lua/nvim-treesitter/info.lua
parenta855538e0aad238b6f8df6750b81f0ef4880092f (diff)
Add TSUpdate command to update parsers
Diffstat (limited to 'lua/nvim-treesitter/info.lua')
-rw-r--r--lua/nvim-treesitter/info.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/info.lua b/lua/nvim-treesitter/info.lua
index 98b75951..092c7c8c 100644
--- a/lua/nvim-treesitter/info.lua
+++ b/lua/nvim-treesitter/info.lua
@@ -76,6 +76,16 @@ local function module_info(mod)
end
end
+function M.installed_parsers()
+ local installed = {}
+ for _, p in pairs(parsers.available_parsers()) do
+ if parsers.has_parser(p) then
+ table.insert(installed, p)
+ end
+ end
+ return installed
+end
+
M.commands = {
TSInstallInfo = {
run = install_info,