summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/install.lua
diff options
context:
space:
mode:
authorKiyan Yazdani <yazdani.kiyan@protonmail.com>2020-06-21 17:32:37 +0200
committerGitHub <noreply@github.com>2020-06-21 17:32:37 +0200
commit2c81ec391877de7c1b0b316299b57ce4ae2e88de (patch)
treefb5b26b84f335c65bf70661ace84d1cdda7db8d7 /lua/nvim-treesitter/install.lua
parent969d496f3fb6d2185aa2c540a8d72cf23f47e456 (diff)
parentdf17a48c85b8e47bc4982b640dbb686e372cd81e (diff)
Merge pull request #90 from kyazdani42/fix/parser-names-as-filetypes
refacto/fix: filetype / parser name distinction
Diffstat (limited to 'lua/nvim-treesitter/install.lua')
-rw-r--r--lua/nvim-treesitter/install.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 381afaa4..c2eeaf76 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -2,7 +2,6 @@ local api = vim.api
local fn = vim.fn
local luv = vim.loop
-local configs = require'nvim-treesitter.configs'
local utils = require'nvim-treesitter.utils'
local parsers = require'nvim-treesitter.parsers'
@@ -103,7 +102,7 @@ local function install(...)
if not string.match(yesno, '^y.*') then return end
end
- local parser_config = configs.get_parser_configs()[ft]
+ local parser_config = parsers.get_parser_configs()[ft]
if not parser_config then
return api.nvim_err_writeln('Parser not available for language '..ft)
end
@@ -122,15 +121,15 @@ end
M.ensure_installed = function(languages)
if type(languages) == 'string' then
if languages == 'all' then
- languages = configs.available_parsers()
+ languages = parsers.available_parsers()
else
languages = {languages}
end
end
- for _, ft in ipairs(languages) do
- if not parsers.has_parser(ft) then
- install(ft)
+ for _, lang in ipairs(languages) do
+ if not parsers.has_parser(lang) then
+ install(lang)
end
end
end