mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
update docs for transform_fn
to reflect additional node argument
This commit is contained in:
parent
22de3532cc
commit
34adfe8e95
1 changed files with 3 additions and 2 deletions
|
|
@ -445,7 +445,7 @@ Default options (lua syntax):
|
|||
{
|
||||
indicator_size = 100,
|
||||
type_patterns = {'class', 'function', 'method'},
|
||||
transform_fn = function(line) return line:gsub('%s*[%[%(%{]*%s*$', '') end,
|
||||
transform_fn = function(line, _node) return line:gsub('%s*[%[%(%{]*%s*$', '') end,
|
||||
separator = ' -> '
|
||||
}
|
||||
<
|
||||
|
|
@ -453,7 +453,8 @@ Default options (lua syntax):
|
|||
the beginning.
|
||||
- `type_patterns` - Which node type patterns to match.
|
||||
- `transform_fn` - Function used to transform the single item in line. By
|
||||
default removes opening brackets and spaces from end.
|
||||
default removes opening brackets and spaces from end. Takes two arguments:
|
||||
the text of the line in question, and the corresponding treesitter node.
|
||||
- `separator` - Separator between nodes.
|
||||
|
||||
*nvim_treesitter#foldexpr()*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue