| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following top level Treesitter functions have been moved:
- vim.treesitter.inspect_language() -> vim.treesitter.language.inspect()
- vim.treesitter.get_query_files() -> vim.treesitter.query.get_files()
- vim.treesitter.set_query() -> vim.treesitter.query.set()
- vim.treesitter.query.set_query() -> vim.treesitter.query.set()
- vim.treesitter.get_query() -> vim.treesitter.query.get()
- vim.treesitter.query.get_query() -> vim.treesitter.query.get()
- vim.treesitter.parse_query() -> vim.treesitter.query.parse()
- vim.treesitter.query.parse_query() -> vim.treesitter.query.parse()
- vim.treesitter.add_predicate() -> vim.treesitter.query.add_predicate()
- vim.treesitter.add_directive() -> vim.treesitter.query.add_directive()
- vim.treesitter.list_predicates() -> vim.treesitter.query.list_predicates()
- vim.treesitter.list_directives() -> vim.treesitter.query.list_directives()
- vim.treesitter.query.get_range() -> vim.treesitter.get_range()
- vim.treesitter.query.get_node_text() -> vim.treesitter.get_node_text()
|
|
|
|
| |
Ignore instead
|
|
|
| |
Fixes #22473
|
|
|
| |
Simply use `pcall` if you want to silence an error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
vim.treesitter does not know how to map a specific filetype to a parser.
This creates problems since in a few places (including in vim.treesitter itself), the filetype is incorrectly used in place of lang.
Solution:
Add an API to enable this:
- Add vim.treesitter.language.add() as a replacement for vim.treesitter.language.require_language().
- Optional arguments are now passed via an opts table.
- Also takes a filetype (or list of filetypes) so we can keep track of what filetypes are associated with which langs.
- Deprecated vim.treesitter.language.require_language().
- Add vim.treesitter.language.get_lang() which returns the associated lang for a given filetype.
- Add vim.treesitter.language.register() to associate filetypes to a lang without loading the parser.
|
|
|
|
|
| |
This allows vim.treesitter.show_tree() to work on buffers where the
filetype does not match the parser language name e.g, bash/sh.
|
|
|
|
|
|
|
|
|
| |
Problem: Some injections (like markdown) allow specifying arbitrary
language names for code blocks, which may be lead to errors when
looking for a corresponding parser in runtime path.
Solution: Validate that the language name only contains alphanumeric
characters and `_` (e.g., for `c_sharp`) and error otherwise.
|
|
|
| |
to ease debug. At one point I had an empty filetype and the current message was not helpful enough
|
| |
|
|
|
|
|
| |
Treesitter parsers are now a mandatory part of the installation and
should be tested on all platforms. Remove `pending_c_parser` helper.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
parser (#18149)
|
| |
|
|
|