feat: add TSConfigInfo to display current config

https://nvim-treesitter.zulipchat.com/#narrow/stream/252271-general/topic/Random/near/210929394
This commit is contained in:
Stephan Seitz 2020-09-23 20:19:03 +02:00 committed by Thomas Vigouroux
parent f925408640
commit 402795997c

View file

@ -154,6 +154,18 @@ local function recurse_modules(accumulator, root, path)
end
end
-- Shows current configuration of all nvim-treesitter modules
-- @param process_function function used as the `process` parameter
-- for vim.inspect (https://github.com/kikito/inspect.lua#optionsprocess)
local function config_info(process_function)
process_function = process_function or function(item, path)
if path[#path] == vim.inspect.METATABLE then return end
if path[#path] == "is_supported" then return end
return item
end
print(vim.inspect(config, {process = process_function}))
end
M.commands = {
TSBufEnable = {
run = enable_module,
@ -183,6 +195,12 @@ M.commands = {
"-complete=custom,nvim_treesitter#available_modules",
},
},
TSConfigInfo = {
run = config_info,
args = {
"-nargs=0",
},
},
}
-- @param mod: module (string)