From 42009ac7df88bfffeea49a83e642fdc6cf9f9447 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Thu, 8 Dec 2022 09:51:46 -0700 Subject: feat(treesitter): add 'lang' option to show_tree() (#21341) This is necessary for now to support filetypes that use a parser with a different name (e.g. the "terraform" filetype uses the "hcl" parser). --- runtime/doc/treesitter.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 71a5fdaad0..096cec6678 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -526,6 +526,7 @@ get_node_at_pos({bufnr}, {row}, {col}, {opts}) • {row} (number) Position row • {col} (number) Position column • {opts} (table) Optional keyword arguments: + • lang string|nil Parser language • ignore_injections boolean Ignore injected languages (default true) @@ -612,6 +613,8 @@ show_tree({opts}) *vim.treesitter.show_tree()* Parameters: ~ • {opts} (table|nil) Optional options table with the following possible keys: + • lang (string|nil): The language of the source buffer. If + omitted, the filetype of the source buffer is used. • bufnr (number|nil): Buffer to draw the tree into. If omitted, a new buffer is created. • winid (number|nil): Window id to display the tree buffer in. -- cgit