Commit Graph

163 Commits

Author SHA1 Message Date
Stephan Seitz
242608e669 feat(treesitter): allow to set highlight priority for queries 2021-07-22 21:38:57 +02:00
Raymond W. Ko
7c95697026
treesitter: add predicate "any-of?" (#14344)
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.
2021-05-14 17:41:20 +02:00
Stephan Seitz
5c9b4948d4
treesitter: do not escape in match? (#14382) 2021-05-11 11:52:47 +02:00
derekstride
44d4526e18
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
```
2021-04-27 12:29:37 -02:30
Thomas Vigouroux
e652b2987a
Merge pull request #14046 from nvim-treesitter/feature/language-tree-directive-config
feat(treesitter): allow injections to be configured through directives
2021-04-14 05:36:05 +02:00
Thomas Vigouroux
e8bc3d717e
feat(ts): include parser ABI version in checkhealth 2021-04-06 19:02:58 +02:00
Steven Sojka
8bea39f372 feat(treesitter): allow injections to be configured through directives 2021-04-02 12:48:16 -05:00
TJ DeVries
d50f99f08b
fixup: remove unused test function 2021-03-31 18:09:03 +02:00
TJ DeVries
06c065469b
ts: Add per-language highlight links 2021-03-31 18:09:00 +02:00
TJ DeVries
d6209a7b84 fixup: Add a test and it is so pretty 2021-03-30 10:57:38 -04:00
“jvgrootveld”
a2818819bb treesitter: default start and end row when omitted
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.
2021-01-15 21:44:40 +01:00
Björn Linse
a58d96a7ed buffer updates: mark sorted region as changed.
NB: currently this invalidates all extmarks inside the region.
Later on within-line extmarks could be preserved
2021-01-03 14:47:37 +01:00
Björn Linse
adb01190c4 tests: make treesitter its own category 2021-01-03 14:47:29 +01:00