| Age | Commit message (Collapse) | Author |
|
|
|
Some languages that are difficult to parse via Treesitter may
incorrectly include whitespace lines at the end of regions. This can
makes the calculated folds sub-optimal.
To recitfy, use a custom directive (trim), to calculate the range with
the trailing whitespace lines removed. Note this only works if the
region end column is 0.
Also added folds for Make.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Add checks for injections.
- Allow queries that start with [A-Z] for highlights only.
- Don't stop on the first error, finish checking all queries.
|
|
|
|
From https://www.lua.org/pil/20.html
> The call string.sub(s,i,j) extracts a piece of the string s, from the i-th to the j-th character inclusive.
This was breaking textobjects movement.
|
|
|
|
|
|
|
|
|
|
The message does not even provide any context where it's coming from
and what it is exactly doing and has to be acknowledged when printed in
conjunction with the "wrote xxx bytes message"
|
|
* added cached to get_query
* added reload function
* fixed message
* added autocommand to reload cache on bufwrite for query file
* pass filename to autocommand v:lua fn
* removed comment
* added metatable
* fixed loop
* Update lua/nvim-treesitter/query.lua
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
* Update lua/nvim-treesitter/query.lua
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
* added do ... end to local query_cache
* made line shorter
Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
|
|
|
|
|
|
|
|
also fixes the memoize_by_buf_tick function
|
|
The following query will result in matches with only one node though it
requires two nodes to be a match.
```scheme
(function_definition
(comment) @function.inner.start
body: (block) @function.inner)
```
Why? First `insert_to_path` is called for `@function.inner.start` which
will result int the following table.
```lua
{ function = { inner = { start { node } } } }
```
`insert_to_path` will overwrite the result
```lua
{ function = { inner = { node } } }
```
Related #552
|
|
|
|
This implements https://github.com/neovim/neovim/pull/13059#issuecomment-704414189
This behaves like modelines and remove the use of the base_language map.
Also, this allows to fine-tune what we actually want to include per
query, which is better IMO.
|
|
The files have the mli extension. The parser grammar uses the name
ocaml_interface, but since vim the underscore has a special meaning
ocamlinterface is used as the filetype.
|
|
We use plural names for all query files except folds.
|
|
Even if it's an empty iterator.
|
|
|
|
These two are doing the same currently.
|
|
|
|
|
|
|
|
Textobjects submodules
|
|
- compute query language extensions *after* default ones
(jsx after javascript)
- remove outdated ts_utils functions from docs
- add better regex detection to javascript
- javascriptreact to use javascript queries
- add javascript.jsx to javascript queries
- write jsx.scm hl file
|
|
|
|
|
|
fix: refactor after upstream refactor
|
|
Starting now, runtime queries will be sourced in this order :
- Queries that are not in any `after` folder, will serve as a base, with
each occurence overwriting the others (that is, .config/nvim/queries has
the highest priority)
- Queries within the `after` directory will be sourced one after the
other.
The rationale is that this reminds all the `.vim` files (ftplugin) for
example, and this allows both to experiment and to override queries
easily.
|
|
|
|
|
|
|
|
|
|
- shared query group stuff -> query.lua
- local-specific stuff from ts_utils -> locals.lua
|
|
|
|
|
|
Allows using another query file for a language, or use a query file
from another language
|
|
|
|
|
|
|
|
- move parser list in `parsers.lua`
- most `ft` variable where changed to `lang`, `ft` is only used on
autocmd binding, and lang is used for everything else. Functions have
been defined to make the switch between `ft` and `lang`
|