mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-04 12:30:01 -04:00
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:
parent
f925408640
commit
402795997c
1 changed files with 18 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue