From b0b4c310973c2b419350e3c05c772596b1c334e9 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 2 Mar 2023 10:01:42 -0500 Subject: refactor: rename show_tree => inspect_tree #22474 Problem: "show" is potentially a new verb that we can avoid (there is already "open" and "echo"). Even if we can't avoid it, the behavior of `show_tree` fits well in the "inspect" family of functions: a way for users to introspect/reflect on the state of Nvim. Existing "inspect" functions: vim.inspect() vim.inspect_pos() vim.treesitter.inspect_language() nvim__inspect_cell Solution: Rename `show_tree` to `inspect_tree`. --- runtime/lua/vim/treesitter.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua index fead7b7b1b..412140b757 100644 --- a/runtime/lua/vim/treesitter.lua +++ b/runtime/lua/vim/treesitter.lua @@ -436,7 +436,7 @@ end --- - title (string|fun(bufnr:integer):string|nil): Title of the window. If a --- function, it accepts the buffer number of the source buffer as its only --- argument and should return a string. -function M.show_tree(opts) +function M.inspect_tree(opts) vim.validate({ opts = { opts, 't', true }, }) @@ -622,6 +622,12 @@ function M.show_tree(opts) }) end +---@deprecated +---@private +function M.show_tree() + vim.deprecate('show_tree', 'inspect_tree', '0.9', nil, false) +end + --- Returns the fold level for {lnum} in the current buffer. Can be set directly to 'foldexpr': ---
lua
 --- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
-- 
cgit