Commit graph

29 commits

Author SHA1 Message Date
Christian Clason
a80fe081b4 feat(predicates)!: rename has-type to kind-eq to align with Helix
No point in having a different name for the same predicate.
2024-06-02 12:07:58 +02:00
milanglacier
19ac9e8b5c
fix(injection): lower-case language name for markdown strings 2024-05-17 08:34:52 +00:00
Christian Clason
b223402ba9 fix(directive): make downcase work on captures 2023-08-12 17:34:15 +02:00
Pham Huy Hoang
78b54eb7f6 chore(injections)!: update injection syntax to 0.9
Since 0.9, @lang syntax is still available as fallback but will soon be deprecated.
Because of that, new syntax should be adopted once 0.9 becomes the
baseline requirements for nvim-treesitter

- update health check
- update doc
2023-08-12 17:34:15 +02:00
Pham Huy Hoang
58d4b924eb fix: add force to all predicates/directives
So that when any of them are upstreamed, there will not be an issue with
re-adding directives anymore
2023-07-01 12:34:30 +02:00
Christian Clason
95850f7964 fix: force upstreamed predicates 2023-05-15 22:31:28 +02:00
Benny Powers
cdc45ac6ba
feat(markdown): configured aliases for fenced code block languages (#4659)
* feat(markdown): configured aliases for languages

* refactor: use vim.treesitter.match

* refactor: rename local vars

* fix: query syntax
2023-04-18 21:51:14 +09:00
Lewis Russell
90ead4ed58 fix: shim 0.9 deprecations 2023-03-24 16:05:38 +01:00
Benny Powers
19d9af8fb0 feat(html): injections in <script type>
refactor(html): remove superfluous injection query

fix(html): associate "module" type with "javascript"
2023-03-22 02:28:21 -04:00
Amaan Qureshi
853b1ab39a style: fill in missing code docs wherever applicable 2023-02-24 01:08:23 -08:00
Lewis Russell
2eaf188269 fix(fold): don't include whitespace end regions
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.
2022-09-12 11:49:51 +01:00
Matthias Deiml
002084b1be
feat(markdown)!: switch to split parser (#3048)
* switch to split markdown parser with separate block and inline parsers to improve performance
* add exclude_children! directive (useful for something like Injected markdown incorrectly highlights indented docstrings #2212)
* split markdown queries into block and inline ones and add the injection for inline into block grammar
* add include_dir option to parser configs (needed because the two grammars don't live in the repos root directory)

BREAKING CHANGE: downstream queries need to be adapted to new parser
2022-06-26 18:02:29 +02:00
Dundar Göc
6a4fdb317d chore: fix typos 2021-11-02 23:47:48 +01:00
Munif Tanjim
35a8fe5a81 fix: query_predicate - nth 2021-08-03 21:45:16 -05:00
Santos Gallegos
8eb8cc61e3 downcase predicate: nil protection
get_node_text could be nil if the range is invalid.

With https://github.com/neovim/neovim/pull/15030/
this fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1531
2021-07-09 20:05:37 +02:00
Santos Gallegos
be8f656087
Use stylua for autoformat code (#1480) 2021-07-04 21:12:17 +00:00
derekstride
e98e2eafa2 downcase! directive to use with ruby injections
```
(#downcase! "language")
```

downcase! will ensure the metadata value for the specified key will be
downcased. If the value is a node, it will downcase the text specified
by the node.

```
(#downcase! @node "key")
```

You can also namespace the key with a specific capture, similar to how
you can call `(#set! @node "key" "value")`
2021-06-04 07:47:21 +02:00
Stephan Seitz
9f12ad1142 Fix "nth?" predicate 2021-01-20 10:39:21 +01:00
Steven Sojka
e602f1b22b fix(query): add noop handler for make-range 2020-12-18 16:40:58 +01:00
Stephan Seitz
3674ad89df fix(predicates): Fix #446: highlight property only if not a method 2020-11-18 21:54:04 +01:00
Stephan Seitz
f4979e5379 feat(predicates): extend has-ancestor?, add has-parent?/has-type? 2020-11-18 21:54:04 +01:00
Stephan Seitz
aa4c3e83e3 Add virtual range for creating node-like objects from multiple nodes 2020-10-26 18:22:19 +01:00
Thomas Vigouroux
355d86fe6b preds: declare set! predicate 2020-09-03 18:19:18 +02:00
Steven Sojka
579c9936d6 feat(highlights): add is predicate 2020-08-16 09:04:07 -05:00
Thomas Vigouroux
98b7515014 fix: refactor after upstream refactor 2020-08-14 15:00:13 +02:00
Steven Sojka
67509d4627 feat(predicates): add adjacent predicate 2020-07-31 11:54:09 -05:00
Stephan Seitz
fae96b588d Predicates: remove function unlispify and use Lisp names directly 2020-07-27 11:07:09 +02:00
Stephan Seitz
6f771507a8 Add predicate: has-ancestor? 2020-07-27 10:15:33 +02:00
Stephan Seitz
5462fc92cb Add predicates module 2020-07-27 10:15:33 +02:00