summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/treesitter/_meta
AgeCommit message (Collapse)AuthorFiles
2026-03-20docs: miscJustin M. Keyes1
2025-12-15Revert "refactor(treesitter): use scratch buffer for string parser" #36964Riley Bruins1
This reverts commit 2a7cb32959b4c616bd2c76ae1933f8e068e391ad.
2025-10-02refactor(treesitter): use scratch buffer for string parser #35988Riley Bruins1
This commit changes `languagetree.lua` so that it creates a scratch buffer under the hood when dealing with string parsers. This will make it much easier to just use extmarks whenever we need to track injection trees in `languagetree.lua`. This also allows us to remove the `treesitter.c` code for parsing a string directly. Note that the string parser's scratch buffer has `set noeol nofixeol` so that the parsed source exactly matches the passed in string.
2025-08-28perf: add on_range in treesitter highlightingvanaigr1
2025-07-02fix(treesitter): ensure TSLuaTree is always immutableRodrigodd1
Problem: The previous fix in #34314 relies on copying the tree in `tree_root` to ensure the `TSNode`'s tree cannot be mutated. But that causes the problem where two calls to `tree_root` return nodes from different copies of a tree, which do not compare as equal. This has broken at least one plugin. Solution: Make all `TSTree`s on the Lua side always immutable, avoiding the need to copy the tree in `tree_root`, and make the only mutation point, `tree_edit`, copy the tree instead.
2025-05-29fix(treesitter): parser metadata annotationsChristian Clason1
Problem: `TSLangInfo` annotation does not reflect the structure returned by `vim.treesitter.language.inspect()`. Solution: Move version information under new (optional since ABI 15 only) `TSLangMetadata` field.
2025-03-29refactor(treesitter): migrate to ts parser callback API #33141Riley Bruins1
Remove the `set_timeout` functions for `TSParser` and instead add a timeout parameter to the regular parse function. Remove these deprecated tree-sitter API functions and replace them with the preferred `TSParseOptions` style.
2025-03-21docs(treesitter): document TSNode:named_children()Riley Bruins1
This commit also gives an internal documentation description for `TSNode:__has_ancestor()`.
2025-03-11feat(treesitter): allow disabling captures and patterns on TSQuery (#32790)Ian Chamberlain2
Problem: Cannot disable individual captures and patterns in treesitter queries. Solution: * Expose the corresponding tree-sitter API functions for `TSQuery` object. * Add documentation for `TSQuery`. * Return the pattern ID from `get_captures_at_pos()` (and hence `:Inspect!`).
2025-03-01feat(treesitter): add more metadata to `language.inspect()` (#32657)Lewis Russell1
Problem: No way to check the version of a treesitter parser. Solution: Add version metadata (ABI 15 parsers only) as well as parser state count and supertype information (ABI 15) in `vim.treesitter.language.inspect()`. Also graduate the `abi_version` field, as this is now the official upstream name. --------- Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2025-02-21fix(treesitter): `TSNode:field()` returns all children with the given fieldRiley Bruins1
2025-01-27docs(treesitter): fix TSNode:range() type signature #32224Riley Bruins1
Uses an overload to properly show the different return type based on the input parameter.
2025-01-27fix: resolve all remaining LuaLS diagnosticsLewis Russell2
2025-01-27build(deps)!: bump tree-sitter to HEAD, wasmtime to v29.0.1 (#32200)Christian Clason1
Breaking change: `ts_node_child_containing_descendant()` was removed Breaking change: tree-sitter 0.25 (HEAD) required
2024-10-11feat(treesitter): introduce child_with_descendant()Riley Bruins1
This commit also marks `child_containing_descendant()` as deprecated (per upstream's documentation), and uses `child_with_descendant()` in its place. Minimum required tree-sitter version will now be `0.24`.
2024-10-03docs(treesitter): generate TSNode, TSTree docs #30643Riley Bruins3
**Problem:** The documentation for `TSNode` and `TSTree` methods is incomplete from the LSP perspective. This is because they are written directly to the vimdoc, rather than in Lua and generated to vimdoc. **Solution:** Migrate the docs to Lua and generate them into the vimdoc. This requires breaking up the `treesitter/_meta.lua` file into a directory with a few different modules. This commit also makes the vimdoc generator slightly more robust with regard to sections that have multiple help tags (e.g. `*one* *two*`)