| Commit message (Collapse) | Author | Age |
|
|
| |
close #20297
|
|
|
|
|
| |
Fix those naughty single quotes.
closes #20159
|
|
|
|
|
| |
* add type annotations to code
* clean up and expand static documentation
* consistent use of tags for static and generated docs
|
|
|
|
| |
Fixes #20139
|
|
|
|
|
| |
Use the first, not last, query for a language on runtimepath. Typically,
this implies that a user query will override a site plugin query, which
will override a bundled runtime query.
|
|
|
|
|
|
|
|
|
|
| |
Problem: Treesitter queries for a given language in runtime were merged together,
leading to errors if they targeted different parser versions (e.g., bundled viml queries
and those shipped by nvim-treesitter).
Solution: Runtime queries now work as follows:
* The last query in the rtp without `; extends` in the header will be used as the base query
* All queries (without a specific order) with `; extends` are concatenated with the base query
BREAKING CHANGE: queries need to be updated if they are meant to extend other queries
|
|
|
|
|
|
| |
feat(treesitter): use weak tables when possible
Also add the defaulttable function to create a table whose values are created when a key is missing.
|
|
|
|
|
|
|
| |
As part of the upstream of utility functions from nvim-treesitter, this
option when set to false allows to return a table (downstream behavior).
Effectively making the switch from the downstream to the upstream
function much easier.
|
|
|
|
|
|
| |
When the node mentioned in a predicate is not required for the query
then predicates putting restrictions on that node shouldn't run.
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/2600
|
|
|
|
|
|
|
|
|
| |
Previously the `offset!` directive populated the metadata in such a way
that the new range could be attributed to a specific capture. #14046
made it so the directive simply stored just the new range in the
metadata and information about what capture the range is based from is
lost.
This change reverts that whilst also correcting the docs.
|
| |
|
|
|
|
| |
minimum_language_version (#17286)
|
|
|
|
| |
The range of node may make `nvim_buf_get_lines` return an empty table.
|
| |
|
| |
|
|
|
|
|
|
| |
Based on https://github.com/neovim/neovim/pull/14445
This extends `vim.treesitter.query.get_node_text` to return the text
that spans a node's range even if start_row ~= end_row.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The official developer documentation in in :h dev-lua-doc specifies to
use "--@" for special/magic tokens. However, this format is not
consistent with EmmyLua notation (used by some Lua language servers) nor
with the C version of the magic docstring tokens which use three comment
characters.
Further, the code base is currently split between usage of "--@",
"---@", and "--- @". In an effort to remain consistent, change all Lua
magic tokens to use "---@" and update the developer documentation
accordingly.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the case of Clojure and other Lisp syntax highlighting, it is
necessary to create huge regexps consisting of hundreds of symbols with
the pipe (|) character. To make things more difficult, these Lisp
symbols sometimes consists of special characters that are themselves
part of special regexp characters like '*'. In addition to being
difficult to maintain, it's performance is suboptimal.
This patch introduces a new predicate to perform 'source' matching in
amortized constant time. This is accomplished by compiling a hash table
on the first use.
|
| |
|
|\
| |
| | |
[RDY] tree-sitter ensure there is a nested table allocated for `#set!`
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes the following bug:
```
test/functional/helpers.lua:107: Error executing lua:
vim/treesitter/query.lua:256: attempt to index a nil value
```
|
|/
|
|
|
|
|
|
|
| |
* doc & fixes: Generate treesitter docs
* fixup to treesitter-core
* docs(treesitter): fix docs for most functions
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
|
|\
| |
| |
| |
| | |
nvim-treesitter/feature/language-tree-directive-config
feat(treesitter): allow injections to be configured through directives
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
| |
Mostly typos I found while reading the code.
|
|
|
|
|
|
|
| |
logic
This function returns the start and stop value if set else the node's range is used
When the node's range is used, the stop is incremented by 1 to make the search inclusive
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for default start and end row when omitted in the
query:iter_captures and query:iter_matches functions.
When the start and end row values are omitted, the values of the given
node is used. The end row value is incremented by 1 to include the node end
row in the match.
Updated tests and docs accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only the plugin/package manager should "manage" after/. Consumers of
nvim_get_runtime_file() should not need to special case it (if your plugin
manager is broken then fix it instead).
Don't use vim.fn.readfile(). Lua can already read files. It is even
better at it than vim script.
expose M.get_query_files(). Listing the queries is essential for user
config debug, and let plugins do fun things with it.
Abstraction-by-obscurity is not useful (plugins can just cargo cult copy
the code anyway, better with public entry points).
|
|
|
|
| |
refactor(treesitter): add directives to queries
|
|
|
|
|
|
|
|
| |
This reverts the handling of base languages to the old way how
nvim-treesitter handled them. When a language extends a base language
it usually wants to be able to overwrite queries.
Related: https://github.com/nvim-treesitter/nvim-treesitter/issues/633
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Runtime queries just work like ftplugins, that is:
- Queries in the `after` directory are sourced _after_ the "base" query
- Otherwise, the last define query takes precedence.
Queries can be found in the `queries` directory.
Update runtime/lua/vim/treesitter/query.lua
Co-authored-by: Paul Burlumi <paul@burlumi.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Escape "\\" only for `vim-match?` not for `match?`
Fixes #12595
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|