diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2020-09-23 20:19:03 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-10-24 10:40:12 +0200 |
| commit | 402795997c9e3ff8fea50e81dbbc4f0a70851c5a (patch) | |
| tree | e1785debf7a64435b481de268f7d23ffec2e5bde /lua | |
| parent | use for first identifier in jsx nested_identifier (diff) | |
| download | nvim-treesitter-402795997c9e3ff8fea50e81dbbc4f0a70851c5a.tar nvim-treesitter-402795997c9e3ff8fea50e81dbbc4f0a70851c5a.tar.gz nvim-treesitter-402795997c9e3ff8fea50e81dbbc4f0a70851c5a.tar.bz2 nvim-treesitter-402795997c9e3ff8fea50e81dbbc4f0a70851c5a.tar.lz nvim-treesitter-402795997c9e3ff8fea50e81dbbc4f0a70851c5a.tar.xz nvim-treesitter-402795997c9e3ff8fea50e81dbbc4f0a70851c5a.tar.zst nvim-treesitter-402795997c9e3ff8fea50e81dbbc4f0a70851c5a.zip | |
feat: add TSConfigInfo to display current config
https://nvim-treesitter.zulipchat.com/#narrow/stream/252271-general/topic/Random/near/210929394
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/configs.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/configs.lua b/lua/nvim-treesitter/configs.lua index 6e1923768..b0d38244e 100644 --- a/lua/nvim-treesitter/configs.lua +++ b/lua/nvim-treesitter/configs.lua @@ -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) |
