diff options
| author | Riley Bruins <ribru17@hotmail.com> | 2024-09-14 12:57:33 -0700 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-09-28 00:31:45 +0200 |
| commit | 0f067cd34d09b38f9aaf2e1732d825e89b573077 (patch) | |
| tree | 7caddf3ad6975ea08f82e6a05a25416c66697a1a /runtime/doc | |
| parent | 7b71fdbc1e9fcb71e642e67e0ac9a2711dd67df0 (diff) | |
| download | rneovim-0f067cd34d09b38f9aaf2e1732d825e89b573077.tar.gz rneovim-0f067cd34d09b38f9aaf2e1732d825e89b573077.tar.bz2 rneovim-0f067cd34d09b38f9aaf2e1732d825e89b573077.zip | |
fix(treesitter): suppress get_parser warnings via opts.error
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/treesitter.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index fea469e63b..21accda2a5 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -818,6 +818,11 @@ get_parser({bufnr}, {lang}, {opts}) *vim.treesitter.get_parser()* If needed, this will create the parser. + If no parser can be created, an error is thrown. Set `opts.error = false` + to suppress this and return nil (and an error message) instead. WARNING: + This behavior will become default in Nvim 0.12 and the option will be + removed. + Parameters: ~ • {bufnr} (`integer?`) Buffer the parser should be tied to (default: current buffer) @@ -825,8 +830,9 @@ get_parser({bufnr}, {lang}, {opts}) *vim.treesitter.get_parser()* filetype) • {opts} (`table?`) Options to pass to the created language tree - Return: ~ - (`vim.treesitter.LanguageTree`) object to use for parsing + Return (multiple): ~ + (`vim.treesitter.LanguageTree?`) object to use for parsing + (`string?`) error message, if applicable get_range({node}, {source}, {metadata}) *vim.treesitter.get_range()* Get the range of a |TSNode|. Can also supply {source} and {metadata} to |